From: Catherine Hoang <catherine.hoang@oracle.com>
To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Cc: djwong@kernel.org, john.g.garry@oracle.com, ritesh.list@gmail.com
Subject: [PATCH v2 2/6] generic/765: adjust various things
Date: Mon, 19 May 2025 18:33:56 -0700 [thread overview]
Message-ID: <20250520013400.36830-3-catherine.hoang@oracle.com> (raw)
In-Reply-To: <20250520013400.36830-1-catherine.hoang@oracle.com>
From: "Darrick J. Wong" <djwong@kernel.org>
Fix some bugs when detecting the atomic write geometry, record what
atomic write geometry we're testing each time through the loop, and
create a group for atomic writes tests.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
common/rc | 4 ++--
doc/group-names.txt | 1 +
tests/generic/765 | 25 ++++++++++++++++++++++++-
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/common/rc b/common/rc
index 0ac90d3e..261fa72a 100644
--- a/common/rc
+++ b/common/rc
@@ -5442,13 +5442,13 @@ _get_atomic_write_unit_min()
_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()
diff --git a/doc/group-names.txt b/doc/group-names.txt
index f510bb82..1b38f73b 100644
--- a/doc/group-names.txt
+++ b/doc/group-names.txt
@@ -12,6 +12,7 @@ acl Access Control Lists
admin xfs_admin functionality
aio general libaio async io tests
atime file access time
+atomicwrites RWF_ATOMIC testing
attr extended attributes
attr2 xfs v2 extended aributes
balance btrfs tree rebalance
diff --git a/tests/generic/765 b/tests/generic/765
index 8695a306..84381730 100755
--- a/tests/generic/765
+++ b/tests/generic/765
@@ -7,7 +7,7 @@
# 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
@@ -34,6 +34,10 @@ get_supported_bsize()
_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()
@@ -70,6 +74,11 @@ test_atomic_writes()
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"
@@ -145,6 +154,15 @@ test_atomic_write_bounds()
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"
@@ -157,6 +175,11 @@ sys_max_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_un
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"
--
2.34.1
next prev parent reply other threads:[~2025-05-20 1:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 1:33 [PATCH v2 0/6] atomic writes tests Catherine Hoang
2025-05-20 1:33 ` [PATCH v2 1/6] generic/765: fix a few issues Catherine Hoang
2025-05-20 2:10 ` Ritesh Harjani
2025-05-22 10:14 ` Ojaswin Mujoo
2025-05-20 1:33 ` Catherine Hoang [this message]
2025-05-22 10:14 ` [PATCH v2 2/6] generic/765: adjust various things Ojaswin Mujoo
2025-05-20 1:33 ` [PATCH v2 3/6] generic/765: move common atomic write code to a library file Catherine Hoang
2025-05-22 10:26 ` Ojaswin Mujoo
2025-05-20 1:33 ` [PATCH v2 4/6] common/atomicwrites: adjust a few more things Catherine Hoang
2025-05-22 10:37 ` Ojaswin Mujoo
2025-05-20 1:33 ` [PATCH v2 5/6] common/atomicwrites: fix _require_scratch_write_atomic Catherine Hoang
2025-05-20 2:14 ` Ritesh Harjani
2025-05-20 1:34 ` [PATCH v2 6/6] generic: various atomic write tests with scsi_debug Catherine Hoang
2025-05-20 12:05 ` Ritesh Harjani
2025-05-21 2:30 ` Darrick J. Wong
2025-05-22 10:33 ` Ojaswin Mujoo
2025-05-28 22:00 ` Darrick J. Wong
2025-05-21 4:43 ` Ritesh Harjani
2025-05-22 10:53 ` Ojaswin Mujoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250520013400.36830-3-catherine.hoang@oracle.com \
--to=catherine.hoang@oracle.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=john.g.garry@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=ritesh.list@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).