[PATCH] nvme: revert the cross-controller atomic write size validation
alan.adamson at oracle.com
alan.adamson at oracle.com
Mon Jul 14 10:22:20 PDT 2025
On 7/14/25 7:44 AM, Christoph Hellwig wrote:
> This was originally added by commit 8695f060a029 ("nvme: all namespaces
> in a subsystem must adhere to a common atomic write size") to check
> the all controllers in a subsystem report the same atomic write size,
> but the check wasn't quite correct and caused problems for devices
> with multiple namespaces that report different LBA sizes. Commit
> f46d273449ba ("nvme: fix atomic write size validation") tried to fix
> this, but then caused problems for namespace rediscovery after a
> format with an LBA size change that changes the AWUPF value.
>
> This drop the validation and essentially revers those two commits while
> keeping the cleanup that went in between the two. We'll need to figure
> out how to properly check for the mouse trap that nvme left us, but for
> now revert the check to keep devices working for users who couldn't care
> less about the atomic write feature.
>
> Fixes: 8695f060a029 ("nvme: all namespaces in a subsystem must adhere to a common atomic write size")
> Fixes: f46d273449ba ("nvme: fix atomic write size validation")
> Signed-off-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Alan Adamson <alan.adamson at oracle.com>
Tested-by: Alan Adamson <alan.adamson at oracle.com>
[root at localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 39G 0 part
└─ol-root 252:0 0 39G 0 lvm /
sr0 11:0 1 1024M 0 rom
nvme2n1 259:1 0 250G 0 disk
nvme2n2 259:3 0 250G 0 disk
nvme2n3 259:5 0 250G 0 disk
nvme2n4 259:8 0 250G 0 disk
nvme2n5 259:9 0 250G 0 disk
[root at localhost ~]# cat testxx.sh
set -x
nvme id-ctrl /dev/$1 | grep cmic
nvme id-ctrl /dev/$1 | grep awun
nvme id-ctrl /dev/$1 | grep awupf
nvme id-ns /dev/$1 | grep nawupf
cat /sys/block/$1/queue/atomic_write_max_bytes
[root at localhost ~]# sh testxx.sh nvme2n1
+ nvme id-ctrl /dev/nvme2n1
+ grep cmic
cmic : 0x2
+ nvme id-ctrl /dev/nvme2n1
+ grep awun
awun : 31
+ nvme id-ctrl /dev/nvme2n1
+ grep awupf
awupf : 15
+ nvme id-ns /dev/nvme2n1
+ grep nawupf
nawupf : 0
+ cat /sys/block/nvme2n1/queue/atomic_write_max_bytes
4096
[root at localhost ~]# sh testxx.sh nvme2n2
+ nvme id-ctrl /dev/nvme2n2
+ grep cmic
cmic : 0x2
+ nvme id-ctrl /dev/nvme2n2
+ grep awun
awun : 15
+ nvme id-ctrl /dev/nvme2n2
+ grep awupf
awupf : 7
+ nvme id-ns /dev/nvme2n2
+ grep nawupf
nawupf : 0
+ cat /sys/block/nvme2n2/queue/atomic_write_max_bytes
4096
[root at localhost ~]# sh testxx.sh nvme2n3
+ nvme id-ctrl /dev/nvme2n3
+ grep cmic
cmic : 0x2
+ grep awun
+ nvme id-ctrl /dev/nvme2n3
awun : 31
+ nvme id-ctrl /dev/nvme2n3
+ grep awupf
awupf : 31
+ grep nawupf
+ nvme id-ns /dev/nvme2n3
nawupf : 0
+ cat /sys/block/nvme2n3/queue/atomic_write_max_bytes
4096
[root at localhost ~]# sh testxx.sh nvme2n4
+ nvme id-ctrl /dev/nvme2n4
+ grep cmic
cmic : 0x2
+ nvme id-ctrl /dev/nvme2n4
+ grep awun
awun : 15
+ nvme id-ctrl /dev/nvme2n4
+ grep awupf
awupf : 15
+ nvme id-ns /dev/nvme2n4
+ grep nawupf
nawupf : 15
+ cat /sys/block/nvme2n4/queue/atomic_write_max_bytes
8192
[root at localhost ~]# sh testxx.sh nvme2n5
+ nvme id-ctrl /dev/nvme2n5
+ grep cmic
cmic : 0x2
+ nvme id-ctrl /dev/nvme2n5
+ grep awun
awun : 15
+ nvme id-ctrl /dev/nvme2n5
+ grep awupf
awupf : 15
+ nvme id-ns /dev/nvme2n5
+ grep nawupf
nawupf : 63
+ cat /sys/block/nvme2n5/queue/atomic_write_max_bytes
32768
[root at localhost ~]# dmesg | grep -i nvme
[ 2.613613] nvme nvme2: pci function 0000:00:06.0
[ 2.615487] nvme nvme0: pci function 0000:00:04.0
[ 2.617269] nvme nvme1: pci function 0000:00:05.0
[ 2.618234] nvme nvme3: pci function 0000:00:07.0
[ 2.707583] nvme nvme0: 1/0/0 default/read/poll queues
[ 2.711550] nvme nvme2: 1/0/0 default/read/poll queues
[ 2.727280] nvme nvme0: Ignoring bogus Namespace Identifiers
[ 2.728661] nvme nvme1: 1/0/0 default/read/poll queues
[ 2.730096] nvme nvme2: Ignoring bogus Namespace Identifiers
[ 2.742041] nvme nvme1: Ignoring bogus Namespace Identifiers
[ 2.752341] nvme nvme3: 1/0/0 default/read/poll queues
[ 2.755530] nvme nvme3: Ignoring bogus Namespace Identifiers
[ 2.755774] nvme nvme3: Ignoring bogus Namespace Identifiers
[root at localhost ~]#
More information about the Linux-nvme
mailing list