Re: [PATCH v4] generic: add a test for atomic writes

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



On 08/04/2025 21:44, Catherine Hoang wrote:
---
  common/rc             |  51 +++++++++++++
  tests/generic/765     | 172 ++++++++++++++++++++++++++++++++++++++++++
  tests/generic/765.out |   2 +
  3 files changed, 225 insertions(+)
  create mode 100755 tests/generic/765
  create mode 100644 tests/generic/765.out
diff --git a/common/rc b/common/rc
index 16d627e1..25e6a1f7 100644


+}
+
+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")
+
+bdev_min_write=$(_get_atomic_write_unit_min $SCRATCH_DEV)
+bdev_max_write=$(_get_atomic_write_unit_max $SCRATCH_DEV)
+
+if [ "$sys_min_write" -ne "$bdev_min_write" ]; then
+    echo "bdev min write != sys min write"
+fi
+if [ "$sys_max_write" -ne "$bdev_max_write" ]; then
+    echo "bdev max write != sys max write"
Note: for large atomic writes according to [0], these may not be the same. I am not sure how this will affect your test.

[0]https://lore.kernel.org/linux-xfs/20250408104209.1852036-1- john.g.garry@xxxxxxxxxx/T/#m374933d93697082f9267515f807930d774c8634b
Ok, I can remove this when large atomic writes gets merged (unless you think
it should be removed now?)

Actually this check is for ensuring that the statx for the bdev is the same as we get from sysfs for the bdev, right? If so, then it is ok to stay.

Thanks,
John




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux