]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: fix invalid extref key setup when replaying dentry
authorFilipe Manana <fdmanana@suse.com>
Wed, 3 Sep 2025 15:53:21 +0000 (16:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 08:58:51 +0000 (10:58 +0200)
commitdea5b468701082f52015c15b447db988f0f3c744
treef6f34938b6559f5b11daf49cd5cb98c95a581368
parent993049c9b1355c78918344a6403427d53f9ee700
btrfs: fix invalid extref key setup when replaying dentry

[ Upstream commit b62fd63ade7cb573b114972ef8f9fa505be8d74a ]

The offset for an extref item's key is not the object ID of the parent
dir, otherwise we would not need the extref item and would use plain ref
items. Instead the offset is the result of a hash computation that uses
the object ID of the parent dir and the name associated to the entry.
So fix this by setting the key offset at replay_one_name() to be the
result of calling btrfs_extref_hash().

Fixes: 725af92a6251 ("btrfs: Open-code name_in_log_ref in replay_one_name")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/tree-log.c