summaryrefslogtreecommitdiff
authorChao Yu <yuchao0@huawei.com>2019-04-26 09:57:54 (GMT)
committer Jaegeuk Kim <jaegeuk@kernel.org>2019-05-09 04:47:06 (GMT)
commit1681a4fc7b7f8ab1efd49e1b97ac72c35a30581a (patch)
tree260b720acc2725fd0035260155997ddade350e83
parent8c22521c5d1d7d8db3cfc7d34a8bfd08f841184f (diff)
downloadcommon-1681a4fc7b7f8ab1efd49e1b97ac72c35a30581a.zip
common-1681a4fc7b7f8ab1efd49e1b97ac72c35a30581a.tar.gz
common-1681a4fc7b7f8ab1efd49e1b97ac72c35a30581a.tar.bz2
f2fs: fix to handle error in f2fs_disable_checkpoint()
In f2fs_disable_checkpoint(), it needs to detect and propagate error number returned from f2fs_write_checkpoint(). Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat
-rw-r--r--fs/f2fs/super.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 73d0e41..cc2e756 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1504,9 +1504,12 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
mutex_lock(&sbi->gc_mutex);
cpc.reason = CP_PAUSE;
set_sbi_flag(sbi, SBI_CP_DISABLED);
- f2fs_write_checkpoint(sbi, &cpc);
+ err = f2fs_write_checkpoint(sbi, &cpc);
+ if (err)
+ goto out_unlock;
sbi->unusable_block_count = 0;
+out_unlock:
mutex_unlock(&sbi->gc_mutex);
restore_flag:
sbi->sb->s_flags = s_flags; /* Restore MS_RDONLY status */