All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Liu Bo <bo.li.liu@oracle.com>, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] fstests: btrfs/143: make test case more reliable
Date: Thu, 16 Nov 2017 10:59:18 +0200	[thread overview]
Message-ID: <2a63cffe-294f-21b9-2095-6c66a9015233@suse.com> (raw)
In-Reply-To: <20171115234759.19168-1-bo.li.liu@oracle.com>



On 16.11.2017 01:47, Liu Bo wrote:
> This changes to use '_scratch_cycle_mount' to drop all caches btrfs could have
> in order to avoid an issue that drop_caches somehow doesn't work on Nikolay's
> box.
> 
> Also use bash -c to run 'read' only when %pid is odd so that we can read the
> faulty disk.
> 
> Reported-by: Nikolay Borisov <nborisov@suse.com>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
> v2: Change 'fadvise -d' to _scratch_cycle_mount.
> 
> To Nikolay,
> 
> I didn't add your tested-by, but could you please verify if this also
> works on your test box?

Just did around 50 runs and didn't fail once. Without it failed on the
second iteration so :

Tested-by: Nikolay Borisov <nborisov@suse.com>

> 
> 
>  tests/btrfs/143 | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/btrfs/143 b/tests/btrfs/143
> index da7bfd8..3875b6c 100755
> --- a/tests/btrfs/143
> +++ b/tests/btrfs/143
> @@ -127,16 +127,16 @@ echo "step 3......repair the bad copy" >>$seqres.full
>  # since raid1 consists of two copies, and the bad copy was put on stripe #1
>  # while the good copy lies on stripe #0, the bad copy only gets access when the
>  # reader's pid % 2 == 1 is true
> -while true; do
> -	# start_fail only fails the following buffered read so the repair is
> -	# supposed to work.
> -	echo 3 > /proc/sys/vm/drop_caches
> -	start_fail
> -	$XFS_IO_PROG -c "pread 0 4K" "$SCRATCH_MNT/foobar" > /dev/null &
> -	pid=$!
> -	wait
> -	stop_fail
> -	[ $((pid % 2)) == 1 ] && break
> +while [[ -z ${result} ]]; do
> +    # invalidate the page cache.
> +    _scratch_cycle_mount
> +
> +    start_fail
> +    result=$(bash -c "
> +        if [[ \$((\$\$ % 2)) -eq 1 ]]; then
> +                exec $XFS_IO_PROG -c \"pread 0 4K\" \"$SCRATCH_MNT/foobar\"
> +        fi");
> +    stop_fail
>  done
>  
>  _scratch_unmount
> 

      reply	other threads:[~2017-11-16  8:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 20:57 [PATCH] fstests: btrfs/143: make test case more reliable Liu Bo
2017-10-24  5:28 ` Nikolay Borisov
2017-10-24  8:51 ` Nikolay Borisov
2017-10-25 10:32 ` Nikolay Borisov
2017-11-15 23:47 ` [PATCH v2] " Liu Bo
2017-11-16  8:59   ` Nikolay Borisov [this message]

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=2a63cffe-294f-21b9-2095-6c66a9015233@suse.com \
    --to=nborisov@suse.com \
    --cc=bo.li.liu@oracle.com \
    --cc=fstests@vger.kernel.org \
    --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.