From: Chao Yu Date: Thu, 19 Nov 2015 08:09:07 +0000 (+0800) Subject: f2fs: fix to report error in f2fs_readdir X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=57b62d29ad5b384775974973087d47755a8c6fcc;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Jaegeuk Kim --- 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) for (; n < npages; n++) { dentry_page = get_lock_data_page(inode, n, false); - if (IS_ERR(dentry_page)) - continue; + if (IS_ERR(dentry_page)) { + err = PTR_ERR(dentry_page); + if (err == -ENOENT) + continue; + else + goto out; + } dentry_blk = kmap(dentry_page);