From: Eryu Guan <eguan@redhat.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] fstests: btrfs: Check false ENOSPC bug caused by incorrect metadata reserve
Date: Wed, 9 Nov 2016 17:43:41 +0800 [thread overview]
Message-ID: <20161109094341.GY27776@eguan.usersys.redhat.com> (raw)
In-Reply-To: <d9a9d224-2f21-5b77-a3e9-de271cd4e755@cn.fujitsu.com>
On Wed, Nov 09, 2016 at 08:24:38AM +0800, Qu Wenruo wrote:
>
>
> At 11/08/2016 06:58 PM, Eryu Guan wrote:
> > On Tue, Nov 08, 2016 at 05:15:15PM +0800, Qu Wenruo wrote:
> > > Due to the fact that btrfs uses different max extent size for
> > > compressed and non-compressed write, it calculates metadata reservation
> > > incorrectly.
> > >
> > > This can leads to false ENOSPC alert for compressed write.
> > >
> > > This test case will check it by using small fs and large nodesize, and
> > > do parallel compressed write to trigger it.
> > >
> > > The fix is not merged and may change in the future, but the function is
> > > good enough:
> > > btrfs: improve inode's outstanding_extents computation
> > > btrfs: fix false enospc for compression
> > >
> > > Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> > > ---
[snip]
> > > +
> > > +# Use small filesystem with maximum nodesize.
> > > +# Since the false ENOSPC happens due to incorrect metadata reservation,
> > > +# larger nodesize and small fs will make it much easier to reproduce
> > > +_scratch_mkfs -b 512M -n 64k >> $seqres.full 2>&1
> >
> > How about override MKFS_OPTIONS and call _scratch_mkfs_sized? e.g.
> >
> > export MKFS_OPTIONS="-n 64k"
> > _scratch_mkfs_sized $((512 * 1024 * 1024))
>
> Overriding MKFS_OPTIONS makes us unable to parse more mkfs options, for
> example to test some incompatible features.
>
> So I'd just parse this mkfs options as extra options.
We should use helpers and not open-code when helpers are available. So
we should really use _scratch_mkfs_sized here.
And "-n 64k" is only to make bug easier to reproduce, but I don't think
it's necessary. In my testings, 50%-75% runs hit the ENOSPC failure on
my x86_64 test vm, even I removed the "-n 64k" mkfs option from the
test.
So I'd say remove "-n 64k" and test whatever mkfs options user
specified.
> >
> > > +_scratch_mount "-o compress"
And compress mount option is not necessary to me either. btrfs compress
is a commonly tested configuration, there's no need to force the
compress option in the test. So we can test other configurations too.
Thanks,
Eryu
next prev parent reply other threads:[~2016-11-09 9:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 9:15 [PATCH] fstests: btrfs: Check false ENOSPC bug caused by incorrect metadata reserve Qu Wenruo
2016-11-08 10:58 ` Eryu Guan
2016-11-09 0:24 ` Qu Wenruo
2016-11-09 9:43 ` Eryu Guan [this message]
2016-11-10 0:34 ` Qu Wenruo
2016-11-10 2:19 ` Dave Chinner
2016-11-10 2:42 ` Qu Wenruo
2016-11-10 3:24 ` Eryu Guan
2016-11-10 4:06 ` Dave Chinner
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=20161109094341.GY27776@eguan.usersys.redhat.com \
--to=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.com \
/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