[PATCH blktests] common/xfs: fix run_xfs_io_xstat for max atomics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When trying to find the value for max atomic write size, a user of
run_xfs_io_xstat calls something like the following:

statx_atomic_min=$(run_xfs_io_xstat /dev/"$md_dev" "stat.atomic_write_unit_max")

And run_xfs_io_xstat will grep for "stat.atomic_write_unit_max" in the raw
statx output. However, since new field "stat.atomic_write_unit_max_opt" was
added for statx, the grep returns 2x values (which is wrong).

Fix by changing the grep to cover the full field name.

This fixes md/002, nvme/059, and scsi/009.

Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx>

diff --git a/common/xfs b/common/xfs
index 79e79e7..9c02414 100644
--- a/common/xfs
+++ b/common/xfs
@@ -134,6 +134,6 @@ run_xfs_io_xstat() {
 	local statx_output
 
 	statx_output=$(xfs_io -c "statx -r -m 0x00010000" "$dev" | \
-		grep "$field" | awk '{ print $3 }')
+		grep "$field =" | awk '{ print $3 }')
 	echo "$statx_output"
 }
-- 
2.43.5





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux