All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Christoph Hellwig <hch@lst.de>, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/9] btrfs/143: use common read repair helpers
Date: Tue, 24 May 2022 21:21:27 +0800	[thread overview]
Message-ID: <118b026d-702e-d219-1101-64ba302554c1@gmx.com> (raw)
In-Reply-To: <20220524071838.715013-6-hch@lst.de>



On 2022/5/24 15:18, Christoph Hellwig wrote:
> Use the common helpers to find the btrfs logical address and to read from
> a specific mirror.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>


Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   tests/btrfs/143 | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/tests/btrfs/143 b/tests/btrfs/143
> index 71db861d..b6ff2a42 100755
> --- a/tests/btrfs/143
> +++ b/tests/btrfs/143
> @@ -34,7 +34,6 @@ _require_scratch_dev_pool 2
>   _require_dm_target dust
>
>   _require_btrfs_command inspect-internal dump-tree
> -_require_command "$FILEFRAG_PROG" filefrag
>
>   _scratch_dev_pool_get 2
>   # step 1, create a raid1 btrfs which contains one 128k file.
> @@ -53,8 +52,7 @@ $XFS_IO_PROG -f -d -c "pwrite -S 0xaa -b 128K 0 128K" "$SCRATCH_MNT/foobar" |\
>   # step 2, corrupt the first 64k of stripe #1
>   echo "step 2......corrupt file extent" >>$seqres.full
>
> -${FILEFRAG_PROG} -v $SCRATCH_MNT/foobar >> $seqres.full
> -logical_in_btrfs=`${FILEFRAG_PROG} -v $SCRATCH_MNT/foobar | _filter_filefrag | cut -d '#' -f 1`
> +logical_in_btrfs=$(_btrfs_get_first_logical $SCRATCH_MNT/foobar)
>   echo "Logical offset is $logical_in_btrfs" >>$seqres.full
>   _scratch_unmount
>
> @@ -74,10 +72,8 @@ echo "step 3......repair the bad copy" >>$seqres.full
>
>   $DMSETUP_PROG message dust-test 0 addbadblock $((physical / 512))
>   $DMSETUP_PROG message dust-test 0 enable
> -while [[ -z $( (( BASHPID % 2 == stripe )) &&
> -	       exec $XFS_IO_PROG -c "pread -b 128K 0 128K" "$SCRATCH_MNT/foobar") ]]; do
> -	:
> -done
> +
> +_btrfs_buffered_read_on_mirror $stripe 2 "$SCRATCH_MNT/foobar" 0 128K
>
>   _cleanup_dust
>

  reply	other threads:[~2022-05-24 13:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24  7:18 two more btrfs read repair tests v2 Christoph Hellwig
2022-05-24  7:18 ` [PATCH 1/9] btrfs: add a helpers for read repair testing Christoph Hellwig
2022-05-24 13:18   ` Qu Wenruo
2022-05-27 11:22   ` Nikolay Borisov
2022-05-27 13:33     ` Christoph Hellwig
2022-05-24  7:18 ` [PATCH 2/9] btrfs/140: use common read repair helpers Christoph Hellwig
2022-05-24 13:21   ` Qu Wenruo
2022-05-24  7:18 ` [PATCH 3/9] btrfs/141: " Christoph Hellwig
2022-05-24 13:21   ` Qu Wenruo
2022-05-24  7:18 ` [PATCH 4/9] btrfs/142: " Christoph Hellwig
2022-05-24 13:21   ` Qu Wenruo
2022-05-24  7:18 ` [PATCH 5/9] btrfs/143: " Christoph Hellwig
2022-05-24 13:21   ` Qu Wenruo [this message]
2022-05-24  7:18 ` [PATCH 6/9] btrfs/157: use _btrfs_get_first_logical Christoph Hellwig
2022-05-24 13:21   ` Qu Wenruo
2022-05-24  7:18 ` [PATCH 7/9] btrfs/215: " Christoph Hellwig
2022-05-24 13:21   ` Qu Wenruo
2022-05-24  7:18 ` [PATCH 8/9] btrfs: test repair with sectors corrupted in multiple mirrors Christoph Hellwig
2022-05-24 13:28   ` Qu Wenruo
2022-06-02 11:30   ` Filipe Manana
2022-06-02 12:07     ` Christoph Hellwig
2022-05-24  7:18 ` [PATCH 9/9] btrfs: test repair with corrupted sectors interleaved over " Christoph Hellwig
2022-05-24 13:30   ` Qu Wenruo

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=118b026d-702e-d219-1101-64ba302554c1@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.