From: Filipe Manana Date: Tue, 18 Jul 2017 19:34:02 +0000 (+0100) Subject: Btrfs: fix dir item validation when replaying xattr deletes X-Git-Tag: v4.14-rc1~373^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e33bf72361bdd764c827e160249a3e06d2a8e2fe;p=platform%2Fkernel%2Flinux-rpi.git 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: 8ee8c2d62d5f ("btrfs: Verify dir_item in replay_xattr_deletes") Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index f20ef21..3a11ae63 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2153,8 +2153,7 @@ process_leaf: u32 this_len = sizeof(*di) + name_len + data_len; char *name; - ret = verify_dir_item(fs_info, path->nodes[0], - path->slots[0], di); + ret = verify_dir_item(fs_info, path->nodes[0], i, di); if (ret) { ret = -EIO; goto out;