Skip to content

Commit

Permalink
f2fs: update ctx->pos correctly when hitting hole in directory
Browse files Browse the repository at this point in the history
This patch fixes to update ctx->pos correctly when hitting hole in
directory.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Chao Yu authored and Jaegeuk Kim committed Oct 26, 2017
1 parent cb7a844 commit ab383be
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/f2fs/dir.c
Original file line number Diff line number Diff line change
@@ -870,7 +870,7 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)
goto out_free;
}

for (; n < npages; n++) {
for (; n < npages; n++, ctx->pos = n * NR_DENTRY_IN_BLOCK) {

/* allow readdir() to be interrupted */
if (fatal_signal_pending(current)) {
@@ -907,7 +907,6 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)
break;
}

ctx->pos = (n + 1) * NR_DENTRY_IN_BLOCK;
kunmap(dentry_page);
f2fs_put_page(dentry_page, 1);
}

0 comments on commit ab383be

Please sign in to comment.