* [PATCH] Btrfs: fix dir item validation when replaying xattr deletes
@ 2017-07-18 19:34 fdmanana
2017-07-19 16:46 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: fdmanana @ 2017-07-18 19:34 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
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 <fdmanana@suse.com>
---
fs/btrfs/tree-log.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index f20ef211a73d..3a11ae63676e 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2153,8 +2153,7 @@ static int replay_xattr_deletes(struct btrfs_trans_handle *trans,
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;
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: fix dir item validation when replaying xattr deletes
2017-07-18 19:34 [PATCH] Btrfs: fix dir item validation when replaying xattr deletes fdmanana
@ 2017-07-19 16:46 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2017-07-19 16:46 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs
On Tue, Jul 18, 2017 at 08:34:02PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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.
Thanks. Fixing this was last on my list of known issue caused by some of
the new 4.13 patches.
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-19 16:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 19:34 [PATCH] Btrfs: fix dir item validation when replaying xattr deletes fdmanana
2017-07-19 16:46 ` David Sterba
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.