From: Bill O'Donnell <bodonnel@redhat.com>
To: fstests@vger.kernel.org
Cc: Bill O'Donnell <bodonnel@redhat.com>
Subject: [PATCH] fstests: generic/352 should accomodate other pwrite behaviors
Date: Wed, 23 Aug 2023 10:43:50 -0500 [thread overview]
Message-ID: <20230823154350.18829-1-bodonnel@redhat.com> (raw)
xfs_io pwrite issues a series of block size writes, but there is no guarantee
that the resulting extent(s) will be singular or contiguous. This behavior is
acceptable, but the test is flawed in that it expects a single extent for a
pwrite.
Modify test to accept any layout for the reflinked logical range.
Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
---
tests/generic/352 | 16 +++++++++++-----
tests/generic/352.out | 2 --
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/tests/generic/352 b/tests/generic/352
index 52ec4850..c4ee8a44 100755
--- a/tests/generic/352
+++ b/tests/generic/352
@@ -48,19 +48,25 @@ _pwrite_byte 0xcdcdcdcd 0 $blocksize $file | _filter_xfs_io
# use reflink to create the rest of the file, whose all extents are all
# pointing to the first extent
for i in $(seq 1 $nr); do
- _reflink_range $file 0 $file $(($i * $blocksize)) $blocksize > /dev/null
+ _reflink_range $file 0 $file $(($i * $blocksize)) $blocksize > $tmp1.out
done
# then call fiemap on that file to test both the shared flag and if
# reserved extent mapping search will cause soft lockup
-$XFS_IO_PROG -c "fiemap -v" $file | _filter_fiemap_flags > $tmp.out
-cat $tmp.out >> $seqres.full
+$XFS_IO_PROG -c "fiemap -v" $file | _filter_fiemap_flags > $tmp2.out
+cat $tmp2.out >> $seqres.full
# refact the $LOAD_FACTOR to 1 to match the golden output
sed -i -e "s/$(($last_extent - 1))/$(($orig_last_extent - 1))/" \
-e "s/$last_extent/$orig_last_extent/" \
- -e "s/$end/$orig_end/" $tmp.out
-cat $tmp.out
+ -e "s/$end/$orig_end/" $tmp2.out
+
+cat $tmp1.out > tmp.1
+cat $tmp2.out > tmp.2
+
+diff tmp.[12]
+rm tmp.1
+rm tmp.2
# success, all done
status=0
diff --git a/tests/generic/352.out b/tests/generic/352.out
index 4ff66c21..ad90ae0d 100644
--- a/tests/generic/352.out
+++ b/tests/generic/352.out
@@ -1,5 +1,3 @@
QA output created by 352
wrote 131072/131072 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0: [0..2097151]: shared
-1: [2097152..2097407]: shared|last
--
2.41.0
next reply other threads:[~2023-08-23 15:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 15:43 Bill O'Donnell [this message]
2023-08-23 16:46 ` [PATCH] fstests: generic/352 should accomodate other pwrite behaviors Darrick J. Wong
2023-08-23 19:55 ` Bill O'Donnell
2023-08-23 20:42 ` Bill O'Donnell
2023-08-23 21:01 ` Bill O'Donnell
2023-08-23 22:18 ` Bill O'Donnell
2023-08-23 22:27 ` Darrick J. Wong
2023-08-24 0:03 ` Qu Wenruo
2023-08-24 3:38 ` Bill O'Donnell
2023-08-24 6:46 ` Qu Wenruo
2023-08-24 12:11 ` Bill O'Donnell
2023-08-24 18:16 ` Eric Sandeen
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=20230823154350.18829-1-bodonnel@redhat.com \
--to=bodonnel@redhat.com \
--cc=fstests@vger.kernel.org \
/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