From: Josef Bacik Date: Mon, 24 Jul 2017 19:14:26 +0000 (-0400) Subject: btrfs: increase ctx->pos for delayed dir index X-Git-Tag: v4.14-rc1~80^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42e9cc46fbe86f83278c14f5d88f353d037258d2;p=thirdparty%2Fkernel%2Flinux.git btrfs: increase ctx->pos for delayed dir index 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 Reviewed-by: Liu Bo Signed-off-by: David Sterba --- diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 8ae409b5a61d7..19e4ad2f3f2e4 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1727,6 +1727,7 @@ int btrfs_readdir_delayed_dir_index(struct dir_context *ctx, if (over) return 1; + ctx->pos++; } return 0; }