From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2 0/2][RESEND] btrfs-progs: handle orphan directories properly
Date: Tue, 8 Mar 2022 18:51:22 +0100 [thread overview]
Message-ID: <20220308175122.GS12643@twin.jikos.cz> (raw)
In-Reply-To: <cover.1645568638.git.josef@toxicpanda.com>
On Tue, Feb 22, 2022 at 05:24:29PM -0500, Josef Bacik wrote:
> v1->v2:
> - use "is_orphan" not "has_orphan_item" in the mode-lowmem code. Somehow the
> compiler didn't warn me of this until I switched to a different branch.
>
> --- Original email ---
> Hello,
>
> While implementing the garbage collection tree I started getting btrfsck errors
> when a test would do rm -rf DIRECTORY and then immediately unmount. This is
> because we stop processing GC items during umount, and thus we left the
> directory with an nlink == 0 and all of its children in the fs tree.
>
> However this isn't a problem with just the GC tree, we can have this happen if
> we fail to do the eviction work at evict time, and we leave the orphan entry in
> place on disk. btrfsck properly ignores problems with inodes that have orphan
> items, except for directory inodes.
>
> Fix this by making sure we don't add any backrefs we find from directory inodes
> that we've find the inode item for and have an nlink == 0.
>
> I generated a test image for this by simply skipping the
> btrfs_truncate_inode_items() work in evict in a kernel and rm -rf'ing a
> directory on a test file system.
>
> With this patch both make test-check and make test-check-lowmem pass all the
> tests, including the new testcase. Thanks,
>
> Josef
>
> Josef Bacik (2):
> btrfs-progs: handle orphan directories properly
> btrfs-progs: add a test to check orphaned directories
Added to devel, thanks.
prev parent reply other threads:[~2022-03-08 17:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 22:24 [PATCH v2 0/2][RESEND] btrfs-progs: handle orphan directories properly Josef Bacik
2022-02-22 22:24 ` [PATCH v2 1/2] " Josef Bacik
2022-02-22 22:24 ` [PATCH v2 2/2] btrfs-progs: add a test to check orphaned directories Josef Bacik
2022-03-08 17:51 ` 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=20220308175122.GS12643@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--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