aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-11-19 03:09:07 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-04 14:52:35 -0500
commit57b62d29ad5b384775974973087d47755a8c6fcc (patch)
tree194a4ff28c70347380e2628b59f1f46079fa6b21 /fs/f2fs/dir.c
parentf478f43fa0d8f38537848d298980955244afdaee (diff)
f2fs: fix to report error in f2fs_readdir
get_lock_data_page in f2fs_readdir can fail due to a lot of reasons (i.e. no memory or IO error...), it's better to report this kind of error to user rather than ignoring it. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 7c1678ba8f92..9de898d2ddff 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -855,8 +855,13 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)
855 855
856 for (; n < npages; n++) { 856 for (; n < npages; n++) {
857 dentry_page = get_lock_data_page(inode, n, false); 857 dentry_page = get_lock_data_page(inode, n, false);
858 if (IS_ERR(dentry_page)) 858 if (IS_ERR(dentry_page)) {
859 continue; 859 err = PTR_ERR(dentry_page);
860 if (err == -ENOENT)
861 continue;
862 else
863 goto out;
864 }
860 865
861 dentry_blk = kmap(dentry_page); 866 dentry_blk = kmap(dentry_page);
862 867