summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorZhiguo Niu <zhiguo.niu@unisoc.com>2024-03-11 15:48:54 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2024-03-12 18:25:17 -0700
commit245930617c9bd85330c78e1a70775e1f61b12f7a (patch)
treeaa6efdbb215c654ff0046b8c4245b008253a9de1 /fs/f2fs/super.c
parent31f85ccc84b82cc7eb122af01f5017fbe1e29289 (diff)
downloadlinux-245930617c9bd85330c78e1a70775e1f61b12f7a.tar.gz
linux-245930617c9bd85330c78e1a70775e1f61b12f7a.tar.bz2
linux-245930617c9bd85330c78e1a70775e1f61b12f7a.zip
f2fs: fix to handle error paths of {new,change}_curseg()
{new,change}_curseg() may return error in some special cases, error handling should be did in their callers, and this will also facilitate subsequent error path expansion in {new,change}_curseg(). Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> Signed-off-by: Chao Yu <chao@kernel.org> Reviewed-by: Chao Yu <chao@kernel.org> 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 c4c4c957a3c9..03f56a7c80fa 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4680,7 +4680,9 @@ reset_checkpoint:
if (err)
goto free_meta;
- f2fs_init_inmem_curseg(sbi);
+ err = f2fs_init_inmem_curseg(sbi);
+ if (err)
+ goto sync_free_meta;
/* f2fs_recover_fsync_data() cleared this already */
clear_sbi_flag(sbi, SBI_POR_DOING);