FS/XFS testing framework
 help / color / mirror / Atom feed
From: Bill O'Donnell <bodonnel@redhat.com>
To: fstests@vger.kernel.org
Cc: Bill O'Donnell <bodonnel@redhat.com>
Subject: [PATCH v2] fstests: generic/352 should accomodate other pwrite behaviors
Date: Fri, 25 Aug 2023 15:09:06 -0500	[thread overview]
Message-ID: <20230825200906.95973-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     | 9 +++++----
 tests/generic/352.out | 6 ++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tests/generic/352 b/tests/generic/352
index 52ec4850..77570bce 100755
--- a/tests/generic/352
+++ b/tests/generic/352
@@ -28,14 +28,15 @@ _require_xfs_io_command "fiemap"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount
 
-blocksize=$((128 * 1024))
+blocksize=$(_get_file_block_size $SCRATCH_MNT)
 _require_congruent_file_oplen $SCRATCH_MNT $blocksize
 file="$SCRATCH_MNT/tmp"
 
 # Golden output is for $LOAD_FACTOR == 1 case
 orig_nr=8192
-orig_last_extent=$(($orig_nr * $blocksize / 512))
-orig_end=$(($orig_last_extent + $blocksize / 512 - 1))
+orig_blocksize=4096
+orig_last_extent=$(($orig_nr * $orig_blocksize / 512))
+orig_end=$(($orig_last_extent + $orig_blocksize / 512 - 1))
 
 # Real output
 nr=$(($orig_nr * $LOAD_FACTOR))
@@ -43,7 +44,7 @@ last_extent=$(($nr * $blocksize / 512))
 end=$(($last_extent + $blocksize / 512 - 1))
 
 # write the initial block for later reflink
-_pwrite_byte 0xcdcdcdcd 0 $blocksize $file | _filter_xfs_io
+_pwrite_byte 0xcdcdcdcd 0 $blocksize $file | _filter_xfs_io > /dev/null
 
 # use reflink to create the rest of the file, whose all extents are all
 # pointing to the first extent
diff --git a/tests/generic/352.out b/tests/generic/352.out
index 4ff66c21..454ff52f 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
+0: [0..65535]: shared
+1: [65536..65543]: shared|last
-- 
2.41.0


             reply	other threads:[~2023-08-25 20:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 20:09 Bill O'Donnell [this message]
2023-08-28 14:16 ` [PATCH v2] fstests: generic/352 should accomodate other pwrite behaviors 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=20230825200906.95973-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