diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-10-29 18:46:34 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-11-23 12:11:12 -0800 |
commit | ed6bd4b146527e7c6934e3582c47d7b857802676 (patch) | |
tree | 8e27ae614b16fcc9bd3e7abfba68049d947f2b69 /fs/f2fs/inline.c | |
parent | 230436b3ef3fd7d4a1da19edf5e87bb2d74e0fc2 (diff) | |
download | linux-ed6bd4b146527e7c6934e3582c47d7b857802676.tar.bz2 |
f2fs: report error of f2fs_fill_dentries
Report error of f2fs_fill_dentries to ->iterate_shared, otherwise when
error ocurrs, user may just list part of dirents in target directory
without any hints.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r-- | fs/f2fs/inline.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 8cab5df539c6..c486ec935a30 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -612,6 +612,7 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx, struct f2fs_inline_dentry *inline_dentry = NULL; struct page *ipage = NULL; struct f2fs_dentry_ptr d; + int err; if (ctx->pos == NR_INLINE_DENTRY) return 0; @@ -624,11 +625,12 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx, make_dentry_ptr(inode, &d, (void *)inline_dentry, 2); - if (!f2fs_fill_dentries(ctx, &d, 0, fstr)) + err = f2fs_fill_dentries(ctx, &d, 0, fstr); + if (!err) ctx->pos = NR_INLINE_DENTRY; f2fs_put_page(ipage, 1); - return 0; + return err < 0 ? err : 0; } int f2fs_inline_data_fiemap(struct inode *inode, |