summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSheng Yong <shengyong1@huawei.com>2018-04-21 14:12:50 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-07-08 17:28:43 -0700
commit23d00b02878ee939100ed8aae68b5ac170899bf2 (patch)
treea56922c821646781ec2a1c8c6c40469697c696ab /fs
parent937f4ef79e257735e03149815fb231c8d02e3a1f (diff)
f2fs: remove duplicated dquot_initialize and fix error handling
This patch removes duplicated dquot_initialize in recover_orphan_inode(), and fix the error handling if dquot_initialize fails. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/checkpoint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 0bdd5bdfeaf9..6d331c21f7ce 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -593,10 +593,11 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
}
err = dquot_initialize(inode);
- if (err)
+ if (err) {
+ iput(inode);
goto err_out;
+ }
- dquot_initialize(inode);
clear_nlink(inode);
/* truncate all the data during iput */