From: Greg KH <gregkh@linuxfoundation.org>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, Filipe Manana <fdmanana@suse.com>,
Boris Burkov <boris@bur.io>, David Sterba <dsterba@suse.com>
Subject: Re: [PATCH 6.6.y] btrfs: don't skip remaining extrefs if dir not found during log replay
Date: Fri, 22 Aug 2025 10:41:58 +0200 [thread overview]
Message-ID: <2025082219-decal-wired-6568@gregkh> (raw)
In-Reply-To: <20250819001451.192078-1-sashal@kernel.org>
On Mon, Aug 18, 2025 at 08:14:51PM -0400, Sasha Levin wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> [ Upstream commit 24e066ded45b8147b79c7455ac43a5bff7b5f378 ]
>
> During log replay, at add_inode_ref(), if we have an extref item that
> contains multiple extrefs and one of them points to a directory that does
> not exist in the subvolume tree, we are supposed to ignore it and process
> the remaining extrefs encoded in the extref item, since each extref can
> point to a different parent inode. However when that happens we just
> return from the function and ignore the remaining extrefs.
>
> The problem has been around since extrefs were introduced, in commit
> f186373fef00 ("btrfs: extended inode refs"), but it's hard to hit in
> practice because getting extref items encoding multiple extref requires
> getting a hash collision when computing the offset of the extref's
> key. The offset if computed like this:
>
> key.offset = btrfs_extref_hash(dir_ino, name->name, name->len);
>
> and btrfs_extref_hash() is just a wrapper around crc32c().
>
> Fix this by moving to next iteration of the loop when we don't find
> the parent directory that an extref points to.
>
> Fixes: f186373fef00 ("btrfs: extended inode refs")
> CC: stable@vger.kernel.org # 6.1+
> Reviewed-by: Boris Burkov <boris@bur.io>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> Signed-off-by: David Sterba <dsterba@suse.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> fs/btrfs/tree-log.c | 25 ++++++++++++++++++++++---
> 1 file changed, 22 insertions(+), 3 deletions(-)
This isn't applying to the 6.6.y queue right now:
patching file fs/btrfs/tree-log.c
Hunk #1 succeeded at 1446 (offset 1 line).
Hunk #2 FAILED at 1458.
Hunk #3 succeeded at 1512 (offset 10 lines).
1 out of 3 hunks FAILED -- rejects in file fs/btrfs/tree-log.c
Can you rebase and resend?
thanks,
greg k-h
prev parent reply other threads:[~2025-08-22 8:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 10:48 FAILED: patch "[PATCH] btrfs: don't skip remaining extrefs if dir not found during" failed to apply to 6.6-stable tree gregkh
2025-08-19 0:14 ` [PATCH 6.6.y] btrfs: don't skip remaining extrefs if dir not found during log replay Sasha Levin
2025-08-22 8:41 ` Greg KH [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=2025082219-decal-wired-6568@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=boris@bur.io \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=sashal@kernel.org \
--cc=stable@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.