summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.c
diff options
context:
space:
mode:
authorJosef Bacik2017-07-24 21:14:26 +0200
committerDavid Sterba2017-08-18 16:36:20 +0200
commit42e9cc46fbe86f83278c14f5d88f353d037258d2 (patch)
treea88c28f8b83f4f0b2eef1281047b33c43310c676 /fs/btrfs/delayed-inode.c
parentbtrfs: fix readdir deadlock with pagefault (diff)
downloadkernel-qcow2-linux-42e9cc46fbe86f83278c14f5d88f353d037258d2.tar.gz
kernel-qcow2-linux-42e9cc46fbe86f83278c14f5d88f353d037258d2.tar.xz
kernel-qcow2-linux-42e9cc46fbe86f83278c14f5d88f353d037258d2.zip
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 <jbacik@fb.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r--fs/btrfs/delayed-inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 8ae409b5a61d..19e4ad2f3f2e 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;
}