]> git.hungrycats.org Git - linux/commitdiff
btrfs: increase ctx->pos for delayed dir index
authorJosef Bacik <jbacik@fb.com>
Mon, 24 Jul 2017 19:14:26 +0000 (15:14 -0400)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 28 Jul 2017 17:43:31 +0000 (13:43 -0400)
Our dir_context->pos is supposed to hold the next position we're
supposed to look.  If we successfully insert a delayed dir index we
could end up with a duplicate entry because we don't increase ctx->pos
after doing the dir_emit.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 599add843fa68d5873a84e7425457f3aa53d3b52)

fs/btrfs/delayed-inode.c

index 1aff676f0e5b5b6c63efd32eee44958b40968e2a..b04c05e529d28f53cbcb808b324b92386231c02c 100644 (file)
@@ -1727,6 +1727,7 @@ int btrfs_readdir_delayed_dir_index(struct dir_context *ctx,
 
                if (over)
                        return 1;
+               ctx->pos++;
        }
        return 0;
 }