diff mbox series

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

Message ID 20250225183108.3881328-2-alan.adamson@oracle.com (mailing list archive)
State New
Headers show
Series common/xfs: verify xfs_io supports statx atomic write attributes | expand

Commit Message

Alan Adamson Feb. 25, 2025, 6:31 p.m. UTC
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@oracle.com>
---
 common/xfs | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Shinichiro Kawasaki Feb. 26, 2025, 12:29 p.m. UTC | #1
On Feb 25, 2025 / 10:31, Alan Adamson wrote:
> 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@oracle.com>

I applied it. Thanks!
diff mbox series

Patch

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}')