From: Qu WenRuo <wqu@suse.com>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Cc: Filipe Manana <FdManana@suse.com>
Subject: Re: [PATCH] fstests: btrfs/157 btrfs/158: Prevent stripe offset to pollute golden output
Date: Wed, 11 Dec 2019 03:22:52 +0000 [thread overview]
Message-ID: <010f5b0e-939a-b2be-70a2-d8670d1696ab@suse.com> (raw)
In-Reply-To: <20191211022207.15359-1-wqu@suse.com>
[-- Attachment #1.1: Type: text/plain, Size: 4160 bytes --]
On 2019/12/11 上午10:22, Qu Wenruo wrote:
> Test btrfs/157 and btrfs/158 are verifying the repair functionality of
> supported RAID profile, thus it needs to corrupt the fs data manually using
> physical offset of data.
>
> However that physical offset of data is dependent on chunk layout, which
> is further dependent on mkfs, so such physical offset is never reliable.
>
> And btrfs-progs commit c501c9e3b816 ("btrfs-progs: mkfs: match devid
> order to the stripe index") changed the mkfs stripe layout, the golden
> output no longer matches the output.
>
> This patch will remove the physical offset from golden output,
> especially since we already have those offsets output in seqres.full.
>
> Reported-by: Filipe Manana <fdmanana@suse.com>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> tests/btrfs/157 | 5 +++--
> tests/btrfs/157.out | 4 ----
> tests/btrfs/158 | 4 ++--
> tests/btrfs/158.out | 4 ----
> 4 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/tests/btrfs/157 b/tests/btrfs/157
> index 7f75c407..9895f1fd 100755
> --- a/tests/btrfs/157
> +++ b/tests/btrfs/157
> @@ -90,8 +90,9 @@ dev3=`echo $SCRATCH_DEV_POOL | awk '{print $3}'`
> # step 2: corrupt the 1st and 2nd stripe (stripe 0 and 1)
> echo "step 2......simulate bitrot at offset $stripe_0 of device_4($dev4) and offset $stripe_1 of device_3($dev3)" >>$seqres.full
>
> -$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_0 64K" $dev4 | _filter_xfs_io
> -$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_1 64K" $dev3 | _filter_xfs_io
> +# These stripe offset is mkfs dependent, don't pollute golden output
> +$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_0 64K" $dev4 > /dev/null
> +$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_1 64K" $dev3 > /dev/null
Please discard this version, it doesn't take devid into consideration.
We need a more flex way to not only get physical offset from a stripe,
but also its devid.
I'll update the patch to be more flex.
Thanks,
Qu
>
> # step 3: read foobar to repair the bitrot
> echo "step 3......repair the bitrot" >> $seqres.full
> diff --git a/tests/btrfs/157.out b/tests/btrfs/157.out
> index 08d592c4..d69c0f1d 100644
> --- a/tests/btrfs/157.out
> +++ b/tests/btrfs/157.out
> @@ -1,10 +1,6 @@
> QA output created by 157
> wrote 131072/131072 bytes at offset 0
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 9437184
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 9437184
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> 0200000 aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa
> *
> 0400000
> diff --git a/tests/btrfs/158 b/tests/btrfs/158
> index 603e8bea..99ee7fb7 100755
> --- a/tests/btrfs/158
> +++ b/tests/btrfs/158
> @@ -82,8 +82,8 @@ dev3=`echo $SCRATCH_DEV_POOL | awk '{print $3}'`
> # step 2: corrupt the 1st and 2nd stripe (stripe 0 and 1)
> echo "step 2......simulate bitrot at offset $stripe_0 of device_4($dev4) and offset $stripe_1 of device_3($dev3)" >>$seqres.full
>
> -$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_0 64K" $dev4 | _filter_xfs_io
> -$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_1 64K" $dev3 | _filter_xfs_io
> +$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_0 64K" $dev4 > /dev/null
> +$XFS_IO_PROG -f -d -c "pwrite -S 0xbb $stripe_1 64K" $dev3 > /dev/null
>
> # step 3: scrub filesystem to repair the bitrot
> echo "step 3......repair the bitrot" >> $seqres.full
> diff --git a/tests/btrfs/158.out b/tests/btrfs/158.out
> index 1f5ad3f7..95562f49 100644
> --- a/tests/btrfs/158.out
> +++ b/tests/btrfs/158.out
> @@ -1,10 +1,6 @@
> QA output created by 158
> wrote 131072/131072 bytes at offset 0
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 9437184
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 9437184
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> 0000000 aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa
> *
> 0400000
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-12-11 3:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 2:22 [PATCH] fstests: btrfs/157 btrfs/158: Prevent stripe offset to pollute golden output Qu Wenruo
2019-12-11 2:22 ` [PATCH] fstests: common: Allow user to keep $seqres.dmesg for all tests Qu Wenruo
2019-12-11 3:22 ` Qu WenRuo [this message]
2019-12-11 6:08 ` [PATCHi RFC] fstest: btrfs/158 fix miss-aligned stripe and device Anand Jain
2019-12-11 7:08 ` Qu Wenruo
2019-12-11 7:23 ` Anand Jain
2019-12-11 7:35 ` Qu Wenruo
2019-12-11 13:33 ` David Sterba
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=010f5b0e-939a-b2be-70a2-d8670d1696ab@suse.com \
--to=wqu@suse.com \
--cc=FdManana@suse.com \
--cc=linux-btrfs@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