Skip to content

Commit e33bf72

Browse files
fdmananakdave
authored andcommitted
Btrfs: fix dir item validation when replaying xattr deletes
We were passing an incorrect slot number to the function that validates directory items when we are replaying xattr deletes from a log tree. The correct slot is stored at variable 'i' and not at 'path->slots[0]', so the call to the validation function was only correct for the first iteration of the loop, when 'i == path->slots[0]'. After this fix, the fstest generic/066 passes again. Fixes: 8ee8c2d ("btrfs: Verify dir_item in replay_xattr_deletes") Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c3cfb65 commit e33bf72

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/btrfs/tree-log.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,8 +2153,7 @@ static int replay_xattr_deletes(struct btrfs_trans_handle *trans,
21532153
u32 this_len = sizeof(*di) + name_len + data_len;
21542154
char *name;
21552155

2156-
ret = verify_dir_item(fs_info, path->nodes[0],
2157-
path->slots[0], di);
2156+
ret = verify_dir_item(fs_info, path->nodes[0], i, di);
21582157
if (ret) {
21592158
ret = -EIO;
21602159
goto out;

0 commit comments

Comments
 (0)