Skip to content

Commit e3e3fe9

Browse files
alanpeteradkawasaki
authored andcommitted
common/xfs: verify xfs_io supports statx atomic write attributes
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. Link: #161 Signed-off-by: Alan Adamson <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 4ba3471 commit e3e3fe9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

common/xfs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ _have_xfs_io_atomic_write() {
1111

1212
_have_program xfs_io || return $?
1313

14+
# Determine if the statx command returns the atomic writes fields.
15+
s=$(xfs_io -c "statx -r -m 0x00010000" /dev/null | grep atomic_write_unit_min)
16+
if [[ $s == "" ]];
17+
then
18+
SKIP_REASONS+=("xfs_io does not support the statx atomic write fields")
19+
return 1
20+
fi
21+
1422
# If the pwrite command supports the -A option then this version
1523
# of xfs_io supports atomic writes.
1624
s=$(xfs_io -c help | grep pwrite | awk '{ print $4}')

0 commit comments

Comments
 (0)