All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guan@eryu.me>
To: Qu Wenruo <wqu@suse.com>
Cc: Eryu Guan <guaneryu@gmail.com>,
	fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] fstests: btrfs/246: add test case to make sure btrfs can create compressed inline extent
Date: Sun, 29 Aug 2021 22:10:08 +0800	[thread overview]
Message-ID: <YSuVQBEX0WU4NQzv@desktop> (raw)
In-Reply-To: <e85d5800-8f4a-5bca-a5a6-e537f2fb998a@suse.com>

On Sun, Aug 29, 2021 at 09:49:05PM +0800, Qu Wenruo wrote:
> 
> 
> On 2021/8/29 下午9:42, Eryu Guan wrote:
> > On Thu, Aug 26, 2021 at 01:34:32PM +0800, Qu Wenruo wrote:
> > > Btrfs has the ability to inline small file extents into its metadata,
> > > and such inlined extents can be further compressed if needed.
> > > 
> > > The new test case is for a regression caused by commit f2165627319f
> > > ("btrfs: compression: don't try to compress if we don't have enough
> > > pages").
> > > 
> > > That commit prevents btrfs from creating compressed inline extents, even
> > > "-o compress,max_inline=2048" is specified, only uncompressed inline
> > > extents can be created.
> > > 
> > > The test case will make sure that the content of the small file is
> > > consistent between cycle mount, then use "btrfs inspect dump-tree" to
> > > verify the created extent is both inlined and compressed.
> > > 
> > > Signed-off-by: Qu Wenruo <wqu@suse.com>
> > 
> > Is there a proposed fix available that could be referenced in the commit
> > log?
> 
> The upstream commit is 4e9655763b82 ("Revert "btrfs: compression: don't try
> to compress if we don't have enough pages""), which is merged after I
> submitted the patch.

Ok. It also could be helpful to just include the proposed patch title if
it's not merged yet.

> 
> > 
> > > ---
> > > Changelog:
> > > v2:
> > > - Also output the sha256sum to make sure the content is consistent
> > > ---
> > >   tests/btrfs/246     | 53 +++++++++++++++++++++++++++++++++++++++++++++
> > >   tests/btrfs/246.out |  5 +++++
> > >   2 files changed, 58 insertions(+)
> > >   create mode 100755 tests/btrfs/246
> > >   create mode 100644 tests/btrfs/246.out
> > > 
> > > diff --git a/tests/btrfs/246 b/tests/btrfs/246
> > > new file mode 100755
> > > index 00000000..e0d8016f
> > > --- /dev/null
> > > +++ b/tests/btrfs/246
> > > @@ -0,0 +1,53 @@
> > > +#! /bin/bash
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +# Copyright (c) 2021 SUSE Linux Products GmbH.  All Rights Reserved.
> > > +#
> > > +# FS QA Test 246
> > > +#
> > > +# Make sure btrfs can create compressed inline extents
> > > +#
> > > +. ./common/preamble
> > > +_begin_fstest auto quick compress
> > > +
> > > +# Override the default cleanup function.
> > > +_cleanup()
> > > +{
> > > +	cd /
> > > +	rm -r -f $tmp.*
> > > +}
> > > +
> > > +# Import common functions.
> > > +. ./common/filter
> > > +# For __populate_find_inode()
> > > +. ./common/populate
> > 
> > This function starts with double underscore, I take it as a 'private'
> > function in common/populate. But all it does is returning the inode
> > number of the given file, I think we could just open-code it in this
> > test as
> > 
> > ino=$(stat -c %i $SCRATCH_MNT/foobar)
> > 
> > Otherwise test looks fine to me.
> 
> Mind me to send an update to include the fix in commit message and use the
> local ino helper?

You're responding quickly, I haven't finalized this week's update yet,
so I can add the fix commit info and remove __populate_find_inode on
commit :)

Thanks,
Eryu

      reply	other threads:[~2021-08-29 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26  5:34 [PATCH v2] fstests: btrfs/246: add test case to make sure btrfs can create compressed inline extent Qu Wenruo
2021-08-29 13:42 ` Eryu Guan
2021-08-29 13:49   ` Qu Wenruo
2021-08-29 14:10     ` Eryu Guan [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=YSuVQBEX0WU4NQzv@desktop \
    --to=guan@eryu.me \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 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.