]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/765: Fix sysfs queue path for nvme partitions
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Fri, 10 Apr 2026 06:36:03 +0000 (12:06 +0530)
committerZorro Lang <zlang@kernel.org>
Mon, 13 Apr 2026 17:42:41 +0000 (01:42 +0800)
This tests checks atomic write limits reported by statx() are same as
the ones reported by sysfs, however nvme partitions don't have the
/sys/block/nvme0n1p1 style entry and also use the namespace's queue
limits for atomic writes. This causes the test to fail because it
expects /sys/block/nvme0n*p* to be present.

Hence, use the new _sysfs_queue_path() helper to get the correct
atomic write limits

Also, fix a small typo (s/awu_min/awu_max) when printing awu limits to
seqres.full

Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/765

index 8c4e0bd02e4e6570397f54158aae0249e2766c7c..09be53dba86a2353a26ed880a3b9ff2037fedda9 100755 (executable)
@@ -94,16 +94,17 @@ test_atomic_writes()
     _scratch_unmount
 }
 
-sys_min_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_unit_min_bytes")
-sys_max_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_unit_max_bytes")
+queue_path=$(_sysfs_queue_path $SCRATCH_DEV)
+sys_min_write=$(cat "$queue_path/atomic_write_unit_min_bytes")
+sys_max_write=$(cat "$queue_path/atomic_write_unit_max_bytes")
 
 bdev_min_write=$(_get_atomic_write_unit_min $SCRATCH_DEV)
 bdev_max_write=$(_get_atomic_write_unit_max $SCRATCH_DEV)
 
 echo "sysfs awu_min $sys_min_write" >> $seqres.full
-echo "sysfs awu_min $sys_max_write" >> $seqres.full
+echo "sysfs awu_max $sys_max_write" >> $seqres.full
 echo "bdev awu_min $bdev_min_write" >> $seqres.full
-echo "bdev awu_min $bdev_max_write" >> $seqres.full
+echo "bdev awu_max $bdev_max_write" >> $seqres.full
 
 # Test that statx atomic values are the same as sysfs values
 if [ "$sys_min_write" -ne "$bdev_min_write" ]; then