From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix subvolume/snapshot deletion not triggered on mount
Date: Wed, 17 Mar 2021 18:57:01 +0100 [thread overview]
Message-ID: <20210317175701.GV7604@twin.jikos.cz> (raw)
In-Reply-To: <5975ac44ce65830fd685896ed66b09eb16c4c4d8.1615912470.git.fdmanana@suse.com>
On Tue, Mar 16, 2021 at 04:53:46PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> During the mount procedure we are calling btrfs_orphan_cleanup() against
> the root tree, which will find all orphans items in this tree. When an
> orphan item corresponds to a deleted subvolume/snapshot (instead of an
> inode space cache), it must not delete the orphan item, because that will
> cause btrfs_find_orphan_roots() to not find the orphan item and therefore
> not add the corresponding subvolume root to the list of dead roots, which
> results in the subvolume's tree never being deleted by the cleanup thread.
>
> The same applies to the remount from RO to RW path.
>
> Fix this by making btrfs_find_orphan_roots() run before calling
> btrfs_orphan_cleanup() against the root tree.
>
> A test case for fstests will follow soon.
>
> Reported-by: Robbie Ko <robbieko@synology.com>
> Link: https://lore.kernel.org/linux-btrfs/b19f4310-35e0-606e-1eea-2dd84d28c5da@synology.com/
> Fixes: 638331fa56caea ("btrfs: fix transaction leak and crash after cleaning up orphans on RO mount")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Added to misc-next, thanks.
prev parent reply other threads:[~2021-03-17 18:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 16:53 [PATCH] btrfs: fix subvolume/snapshot deletion not triggered on mount fdmanana
2021-03-17 17:57 ` 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=20210317175701.GV7604@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox