All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] fstests: btrfs/150 regression test for reading compressed data
Date: Fri, 22 Sep 2017 12:33:49 -0700	[thread overview]
Message-ID: <20170922193348.GC8109@lim.localdomain> (raw)
In-Reply-To: <20170921043952.GQ10621@dastard>

On Thu, Sep 21, 2017 at 02:39:52PM +1000, Dave Chinner wrote:
> On Wed, Sep 20, 2017 at 05:52:43PM -0600, Liu Bo wrote:
> > We had a bug in btrfs compression code which could end up with a
> > kernel panic.
> > 
> > This is adding a regression test for the bug and I've also sent a
> > kernel patch to fix the bug.
> > 
> > The patch is "Btrfs: fix kernel oops while reading compressed data".
> > 
> > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> > ---
> >  tests/btrfs/150     | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tests/btrfs/150.out |   3 ++
> >  tests/btrfs/group   |   1 +
> >  3 files changed, 106 insertions(+)
> >  create mode 100755 tests/btrfs/150
> >  create mode 100644 tests/btrfs/150.out
> > 
> > diff --git a/tests/btrfs/150 b/tests/btrfs/150
> > new file mode 100755
> > index 0000000..834be51
> > --- /dev/null
> > +++ b/tests/btrfs/150
> > @@ -0,0 +1,102 @@
> > +#! /bin/bash
> > +# FS QA Test btrfs/150
> > +#
> > +# This is a regression test which ends up with a kernel oops in btrfs.
> 
> group += dangerous

OK.

> 
> > +# It occurs when btrfs's read repair happens while reading a compressed
> > +# extent.
> > +# The patch for this is 
> > +# xxxxx
> 
> Incomplete?

Urr, thanks for pointing it out.

> 
> > +#
> > +#-----------------------------------------------------------------------
> > +# Copyright (c) 2017 Liu Bo.  All Rights Reserved.
> 
> You're signing off this patch an Oracle employee, but claiming
> personal copyright. Please clarify who owns the copyright - if it's
> your personal copyright then please sign off with a personal email
> address, not your employer's...
> 
> Also, I note that these recently added tests from you:
> 
> tests/btrfs/140:# Copyright (c) 2017 Liu Bo.  All Rights Reserved.
> tests/btrfs/141:# Copyright (c) 2017 Liu Bo.  All Rights Reserved.
> tests/btrfs/142:# Copyright (c) 2017 Liu Bo.  All Rights Reserved.
> tests/btrfs/143:# Copyright (c) 2017 Liu Bo.  All Rights Reserved.
> tests/generic/406:# Copyright (c) 2017 Liu Bo.  All Rights Reserved.
> 
> all have this same ambiguity - personal copyright with employer
> signoff in the commit. This definitely needs clarification and
> fixing if it is wrong....
>

All right, will fix all of them (in a separate one).

> 
> > +disable_io_failure()
> > +{
> > +        echo 0 > $SYSFS_BDEV/make-it-fail
> > +        echo 0 > $DEBUGFS_MNT/fail_make_request/probability
> > +        echo 0 > $DEBUGFS_MNT/fail_make_request/times
> > +}
> > +
> > +_scratch_pool_mkfs "-d raid1 -b 1G" >> $seqres.full 2>&1
> > +
> > +# It doesn't matter which compression algorithm we use.
> > +_scratch_mount -ocompress
> > +
> > +# Create a file with all data being compressed
> > +$XFS_IO_PROG -f -c "pwrite -W 0 8K" $SCRATCH_MNT/foobar | _filter_xfs_io
> 
> needs an fsync to reach disk.

'pwrite -W' has ensured that.

> 
> > +# Raid1 consists of two copies and btrfs decides which copy to read by reader's
> > +# %pid.  Now we inject errors to copy #1 and copy #0 is good.  We want to read
> > +# the bad copy to trigger read-repair.
> > +while true; do
> > +	disable_io_failure
> > +	# invalidate the page cache
> > +	$XFS_IO_PROG -f -c "fadvise -d 0 128K" $SCRATCH_MNT/foobar | _filter_xfs_io
> > +
> > +	enable_io_failure
> > +	od -x $SCRATCH_MNT/foobar > /dev/null &
> 
> why are you using od to read the data when the output is piped to
> dev/null? why not just xfs_io -c "pread 0 8k" ?

Oh yes, that's better, will do.

thanks,

-liubo

  reply	other threads:[~2017-09-22 19:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 23:52 [PATCH] fstests: btrfs/150 regression test for reading compressed data Liu Bo
2017-09-21  4:39 ` Dave Chinner
2017-09-22 19:33   ` Liu Bo [this message]
2017-09-21  7:03 ` Lu Fengqi
2017-09-21  7:03   ` Lu Fengqi
2017-09-22 19:28   ` Liu Bo
2017-09-22 23:21 ` [PATCH v2] " Liu Bo
2017-09-24  7:15   ` Lu Fengqi
2017-09-24  7:15     ` Lu Fengqi
2017-09-26  9:02   ` Eryu Guan
2017-09-26 23:37     ` Liu Bo
2017-09-27  0:18       ` Liu Bo
2017-09-27  9:46         ` Eryu Guan
2017-09-27 17:10           ` Liu Bo
2017-09-27 16:35 ` [PATCH v3] " Liu Bo

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=20170922193348.GC8109@lim.localdomain \
    --to=bo.li.liu@oracle.com \
    --cc=david@fromorbit.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.