diff options
| author | Chao Yu <chao2.yu@samsung.com> | 2015-11-19 16:09:07 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:32:27 +0200 |
| commit | 119307b4c5569224df04e24a553ddd2e34b7ae67 (patch) | |
| tree | 6293ecf41becd3f6afd9c378234140d8500e4b3f | |
| parent | 1b45a937b81153c942d40a581ee4f39f153895ae (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>
| -rw-r--r-- | fs/f2fs/dir.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index df3bad65a..32297a449 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -866,8 +866,13 @@ static int f2fs_readdir(struct file *file, void *dirent, filldir_t filldir) 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); |
