summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-09-03 16:53:21 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-25 11:00:05 +0200
commit5d2c34ff78b89e53cc964a9b423ccb95c1a0c9fd (patch)
tree31dfbae29f656459aef42b6c79d828b246f411dd /fs
parent4a1e3ec28e8062cd9f339aa6a942df9c5bcb6811 (diff)
downloadlinux-5d2c34ff78b89e53cc964a9b423ccb95c1a0c9fd.tar.gz
linux-5d2c34ff78b89e53cc964a9b423ccb95c1a0c9fd.tar.bz2
linux-5d2c34ff78b89e53cc964a9b423ccb95c1a0c9fd.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/tree-log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index e5d6bc1bb5e5..4b53e19f7520 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1998,7 +1998,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
search_key.objectid = log_key.objectid;
search_key.type = BTRFS_INODE_EXTREF_KEY;
- search_key.offset = key->objectid;
+ search_key.offset = btrfs_extref_hash(key->objectid, name.name, name.len);
ret = backref_in_log(root->log_root, &search_key, key->objectid, &name);
if (ret < 0) {
goto out;