_get_atomic_write_unit_max()
{
$XFS_IO_PROG -c "statx -r -m $STATX_WRITE_ATOMIC" $1 | \
- grep atomic_write_unit_max | grep -o '[0-9]\+'
+ grep -w atomic_write_unit_max | grep -o '[0-9]\+'
}
_get_atomic_write_segments_max()
{
$XFS_IO_PROG -c "statx -r -m $STATX_WRITE_ATOMIC" $1 | \
- grep atomic_write_segments_max | grep -o '[0-9]\+'
+ grep -w atomic_write_segments_max | grep -o '[0-9]\+'
}
_require_scratch_write_atomic()
# Validate atomic write support
#
. ./common/preamble
-_begin_fstest auto quick rw
+_begin_fstest auto quick rw atomicwrites
_require_scratch_write_atomic
_require_xfs_io_command pwrite -A
_notrun "$FSTYP does not support atomic writes"
;;
esac
+
+ echo "fs config ------------" >> $seqres.full
+ echo "min_bsize $min_bsize" >> $seqres.full
+ echo "max_bsize $max_bsize" >> $seqres.full
}
get_mkfs_opts()
file_max_write=$(_get_atomic_write_unit_max $testfile)
file_max_segments=$(_get_atomic_write_segments_max $testfile)
+ echo "test $bsize --------------" >> $seqres.full
+ echo "file awu_min $file_min_write" >> $seqres.full
+ echo "file awu_max $file_max_write" >> $seqres.full
+ echo "file awu_segments $file_max_segments" >> $seqres.full
+
# Check that atomic min/max = FS block size
test $file_min_write -eq $bsize || \
echo "atomic write min $file_min_write, should be fs block size $bsize"
testfile=$SCRATCH_MNT/testfile
touch $testfile
+ file_min_write=$(_get_atomic_write_unit_min $testfile)
+ file_max_write=$(_get_atomic_write_unit_max $testfile)
+ file_max_segments=$(_get_atomic_write_segments_max $testfile)
+
+ echo "test awb $bsize --------------" >> $seqres.full
+ echo "file awu_min $file_min_write" >> $seqres.full
+ echo "file awu_max $file_max_write" >> $seqres.full
+ echo "file awu_segments $file_max_segments" >> $seqres.full
+
$XFS_IO_PROG -dc "pwrite -A -D -V1 -b $bsize 0 $bsize" $testfile 2>> $seqres.full && \
echo "atomic write should fail when bsize is out of bounds"
bdev_min_write=$(_get_atomic_write_unit_min $SCRATCH_DEV)
bdev_max_write=$(_get_atomic_write_unit_max $SCRATCH_DEV)
+echo "sysfs awu_min $sys_min_write" >> $seqres.full
+echo "sysfs awu_min $sys_max_write" >> $seqres.full
+echo "bdev awu_min $bdev_min_write" >> $seqres.full
+echo "bdev awu_min $bdev_max_write" >> $seqres.full
+
# Test that statx atomic values are the same as sysfs values
if [ "$sys_min_write" -ne "$bdev_min_write" ]; then
echo "bdev min write != sys min write"