[PATCH blktests 1/1] common/xfs: verify xfs_io supports statx atomic write attributes

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

 



xfs_io atomic write support is a dependency of the scsi and nvme atomic write
tests. The xfs_io atomic write support was introduced across different
versions so if xfs_io pwrite supports the -A (Atomic Write) option, it doesn't
necessarily support statx atomic write fields so that needs to be verified
separately.

Signed-off-by: Alan Adamson <alan.adamson@xxxxxxxxxx>
---
 common/xfs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/xfs b/common/xfs
index 10ecda7c75c8..79e79e7f45ae 100644
--- a/common/xfs
+++ b/common/xfs
@@ -11,6 +11,14 @@ _have_xfs_io_atomic_write() {
 
 	_have_program xfs_io || return $?
 
+	# Determine if the statx command returns the atomic writes fields.
+	s=$(xfs_io -c "statx -r -m 0x00010000" /dev/null | grep atomic_write_unit_min)
+	if [[ $s == "" ]];
+	then
+		SKIP_REASONS+=("xfs_io does not support the statx atomic write fields")
+		return 1
+	fi
+
 	# If the pwrite command supports the -A option then this version
 	# of xfs_io supports atomic writes.
 	s=$(xfs_io -c help | grep pwrite | awk '{ print $4}')
-- 
2.43.5





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux