diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-25 23:29:11 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-03 03:05:18 +0200 |
commit | 42d964016e2760d75144f41cc78ad8bdca8dc240 (patch) | |
tree | cf756698813e7d039c6bd6cb98f505f8b58351ef /fs/f2fs/namei.c | |
parent | f2fs: remove writepages lock (diff) | |
download | linux-42d964016e2760d75144f41cc78ad8bdca8dc240.tar.xz linux-42d964016e2760d75144f41cc78ad8bdca8dc240.zip |
f2fs: propagate error given by f2fs_find_entry
If we get ENOMEM or EIO in f2fs_find_entry, we should stop right away.
Otherwise, for example, we can get duplicate directory entry by ->chash and
->clevel.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/f2fs/namei.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 496f4e3018b2..3f6119e94a78 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -232,6 +232,9 @@ static int __recover_dot_dentries(struct inode *dir, nid_t pino) if (de) { f2fs_dentry_kunmap(dir, page); f2fs_put_page(page, 0); + } else if (IS_ERR(page)) { + err = PTR_ERR(page); + goto out; } else { err = __f2fs_add_link(dir, &dot, NULL, dir->i_ino, S_IFDIR); if (err) @@ -242,6 +245,8 @@ static int __recover_dot_dentries(struct inode *dir, nid_t pino) if (de) { f2fs_dentry_kunmap(dir, page); f2fs_put_page(page, 0); + } else if (IS_ERR(page)) { + err = PTR_ERR(page); } else { err = __f2fs_add_link(dir, &dotdot, NULL, pino, S_IFDIR); } |