Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: "Stéphane Lesimple" <stephane_btrfs2@lesimple.fr>
Cc: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: check: allow force v1 space cache cleanup even the fs has v2 space cache enabled
Date: Thu, 14 Jan 2021 19:49:54 +0100	[thread overview]
Message-ID: <20210114184954.GE6430@twin.jikos.cz> (raw)
In-Reply-To: <e471c466476658fd6c40cdaf71748d52@lesimple.fr>

On Tue, Dec 29, 2020 at 09:34:51AM +0000, Stéphane Lesimple wrote:
> December 29, 2020 1:32 AM, "Qu Wenruo" <wqu@suse.com> wrote:
> 
> > There are cases where v1 free space cache is still left while user has
> > already enabled v2 cache.
> > 
> > In that case, we still want to force v1 space cache cleanup in
> > btrfs-check.
> > 
> > This patch will remove the v2 check if we're cleaning up v1 cache,
> > allowing us to cleanup the leftover.
> > 
> > Signed-off-by: Qu Wenruo <wqu@suse.com>
> > ---
> > check/main.c | 6 ------
> > 1 file changed, 6 deletions(-)
> > 
> > diff --git a/check/main.c b/check/main.c
> > index 8ad7f5886f06..f4755d260bfe 100644
> > --- a/check/main.c
> > +++ b/check/main.c
> > @@ -9917,12 +9917,6 @@ static int do_clear_free_space_cache(int clear_version)
> > int ret = 0;
> > 
> > if (clear_version == 1) {
> > - if (btrfs_fs_compat_ro(gfs_info, FREE_SPACE_TREE)) {
> > - error(
> > - "free space cache v2 detected, use --clear-space-cache v2");
> > - ret = 1;
> > - goto close_out;
> > - }
> > ret = clear_free_space_cache();
> > if (ret) {
> > error("failed to clear free space cache");
> > -- 
> > 2.29.2
> 
> 
> Maybe we should keep the message but make it not fatal?
> Something like "free space cache v2 detected, use --clear-space-cache
> v2 to clear it. Proceeding in clearing potential v1 leftovers as
> asked..."?

This sounds like a good option, thanks. I'll update the patch when I
commit it.

      reply	other threads:[~2021-01-14 18:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29  0:30 [PATCH] btrfs-progs: check: allow force v1 space cache cleanup even the fs has v2 space cache enabled Qu Wenruo
2020-12-29  9:34 ` Stéphane Lesimple
2021-01-14 18:49   ` David Sterba [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=20210114184954.GE6430@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=stephane_btrfs2@lesimple.fr \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox