All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH 0/3] btrfs-progs: detect and fix orphan roots without orphan items
Date: Fri, 11 Feb 2022 13:29:59 +0800	[thread overview]
Message-ID: <71663419-4771-7c7e-1d01-4d55da851c40@suse.com> (raw)
In-Reply-To: <20210625071322.221780-1-wqu@suse.com>

Hi David,

Any idea why the patchest is not merged yet?

In fact we got a newer report on the same problem, which this patchset 
is definitely going to help:

https://lore.kernel.org/linux-btrfs/c75599fa-3b4e-5a5a-c695-75c99b315a06@gmail.com/

It has two subvolumes which has 0 refs, but no ORPHAN item for it.

Thanks,
Qu

On 2021/6/25 15:13, Qu Wenruo wrote:
> There is bug report from Zhenyu Wu <wuzy001@gmail.com>, where even there
> is only one subvolume, his filesystem still consumes way more space than
> expected.
> 
> The problem is, there are 58 snapshots, but all of them have no
> ROOT_REF/ROOT_BACKREF, and all their root refs is 0.
> 
> But strangely there is no orphan items for them.
> 
> This means, btrfs kernel module won't detect them as orphan nor queue
> them to be removed.
> 
> "btrfs subvolume delete -i" do no helps, as it still requires
> ROOT_BACKREF to resolve the dentry.
> 
> For now, we should teach btrfs check to detect and repair the case by
> adding new orphan items for them.
> 
> The root cause I guess is some strange behavior for orphan item insert
> and subvolume unlink.
> As the report mentioned that he had one forced power off.
> 
> Qu Wenruo (3):
>    btrfs-progs: check/lowmem: add the ability to detect and repair orphan
>      subvolume trees which doesn't have orphan item
>    btrfs-progs: check/original: detect and repair orphan subvolume
>      without orphan item
>    btrfs-progs: fsck-tests: add test image for orphan roots without an
>      orphan item
> 
>   check/main.c                                  |  37 ++++--------
>   check/mode-common.c                           |  56 ++++++++++++++++++
>   check/mode-common.h                           |   3 +
>   check/mode-lowmem.c                           |  42 +++++++------
>   .../048-orphan-roots/.lowmem_repairable       |   0
>   .../048-orphan-roots/default.img.xz           | Bin 0 -> 2584 bytes
>   6 files changed, 93 insertions(+), 45 deletions(-)
>   create mode 100644 tests/fsck-tests/048-orphan-roots/.lowmem_repairable
>   create mode 100644 tests/fsck-tests/048-orphan-roots/default.img.xz
> 


      parent reply	other threads:[~2022-02-11  5:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  7:13 [PATCH 0/3] btrfs-progs: detect and fix orphan roots without orphan items Qu Wenruo
2021-06-25  7:13 ` [PATCH 1/3] btrfs-progs: check/lowmem: add the ability to detect and repair orphan subvolume trees which doesn't have orphan item Qu Wenruo
2021-06-25  8:58   ` Anand Jain
2021-06-25  9:08     ` Qu Wenruo
2021-06-25  7:13 ` [PATCH 2/3] btrfs-progs: check/original: detect and repair orphan subvolume without " Qu Wenruo
2021-06-25  7:13 ` [PATCH 3/3] btrfs-progs: fsck-tests: add test image for orphan roots without an " Qu Wenruo
2022-02-11  5:29 ` Qu Wenruo [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=71663419-4771-7c7e-1d01-4d55da851c40@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.cz \
    --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.