summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-08-07 17:58:43 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-14 16:02:14 -0700
commit8c14bfadeac2a01b305ef4434907295b81b58db2 (patch)
tree3eda77311b4fefdb284ef157e46ff50a21710873 /fs/f2fs/super.c
parent47e70ca46f9074efe6573263c0de5bef0af829de (diff)
downloadlinux-8c14bfadeac2a01b305ef4434907295b81b58db2.tar.bz2
f2fs: handle error of f2fs_iget correctly
In recover_orphan_inode, whenever f2fs_iget fail, we will make kernel panic, but it's not reasonable, because f2fs_iget can fail due to a lot of reasons including out of memory. So we change error handling method as below: a) when finding no entry for the orphan inode, bug_on for catching bugs; b) for other reasons, report it to caller. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index a79b6b5a4eeb..4db5cd9fb4b9 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1245,7 +1245,9 @@ try_onemore:
f2fs_join_shrinker(sbi);
/* if there are nt orphan nodes free them */
- recover_orphan_inodes(sbi);
+ err = recover_orphan_inodes(sbi);
+ if (err)
+ goto free_node_inode;
/* read root inode and dentry */
root = f2fs_iget(sb, F2FS_ROOT_INO(sbi));