public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eryu Guan <eguan@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] xfs: tests extent size hint size overflows
Date: Fri, 29 May 2015 11:20:31 +1000	[thread overview]
Message-ID: <20150529012031.GD4316@dastard> (raw)
In-Reply-To: <20150527033404.GE3672@dhcp-13-216.nay.redhat.com>

On Wed, May 27, 2015 at 11:34:04AM +0800, Eryu Guan wrote:
> On Wed, May 27, 2015 at 12:43:37PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > in certain cases, the extent size hints can cause maximum extent
> > size overflows resulting in extent tree corruptions. This test
> > exercises the original reproducer, and another corner case
> > demonstrated to expose problems on 1k block size filesystems.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
....
> > +rm -f $seqres.full
> > +
> > +_require_test
> > +_require_xfs_io_command "falloc"
> > +
> > +# we use loop devices for this so that we can create large files for prealloc
> > +# without having to care about the underlying device size.
> > +_require_loop
> > +
> > +LOOP_FILE=$TESTDIR/$seq.img
> > +LOOP_MNT=$TESTDIR/$seq.mnt
> 
> This should be $TEST_DIR, TESTDIR is empty and ends up in /074.mnt

Oops, will fix.

> > +mkdir -p $LOOP_MNT
> > +$XFS_IO_PROG -ft -c "truncate 1t" $LOOP_FILE 2>&1 > $seqres.full
> 
> This will leave stderr to stdout, then only stdout goes to $seqres.full
> I see "+ fallocate: No space left on device" when testing.

Why would the truncate command give an "fallocate" failure?

And, besides, allowing stderr to be exposed is done on purpose - an
error in the execution of the truncate command will trigger a test
failure because stderr is captured by the test harness...

> "command >$seqres.full 2>&1" will do the work.
> 
> > +LOOP_DEV=`_create_loop_device $LOOP_FILE`
> > +
> > +_mkfs_dev -d size=40051712b,agcount=4 -l size=32m $LOOP_DEV
> > +_mount $LOOP_DEV $LOOP_MNT
> > +
> > +# Corrupt the BMBT by creating extents larger than MAXEXTLEN
> > +$XFS_IO_PROG -ft \
> > +	-c "extsize 16m" \
> > +	-c "falloc 0 30g" \
> > +	$LOOP_MNT/foo 2>&1 > $seqres.full
> 
> Here too, and should append to $seqres.full with ">>"

Will fix.

> 
> > +
> > +umount $LOOP_MNT
> > +_check_xfs_filesystem $LOOP_DEV none none
> 
> I think '_check_scratch_fs $LOOP_DEV' is eaiser, it accepts optional
> device argument to check and deal with SCRATCH_LOG and SCRATCH_RT
> internally.

But it's not the scratch device I'm using. i.e. it doesn't use
SCRATCH_LOG or SCRATCH_RT because I didn't use _scratch_mkfs to
create the filesystem, nor am I using _scratch_mount, so it would
fail to mount if mkfs used external devices....

> > --- /dev/null
> > +++ b/tests/xfs/074.out
> > @@ -0,0 +1,2 @@
> > +QA output created by 074-extsz-hints-vs-maxextlen
> 
> This should be "QA output created by 074"

Hmm - the patch is stale then. That's strange, because I pulled it
from the git tree to my test machines, and they didn't fail. I'll
fix it.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2015-05-29  1:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27  2:43 [PATCH] xfs: tests extent size hint size overflows Dave Chinner
2015-05-27  3:34 ` Eryu Guan
2015-05-29  1:20   ` Dave Chinner [this message]
2015-05-29  2:51     ` Eryu Guan
2015-05-29  3:24       ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2015-05-29  3:52 Dave Chinner
2015-05-29  4:17 ` Eryu Guan

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=20150529012031.GD4316@dastard \
    --to=david@fromorbit.com \
    --cc=eguan@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