diff options
author | Zhiguo Niu <zhiguo.niu@unisoc.com> | 2024-03-11 10:48:54 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-03-13 04:25:17 +0300 |
commit | 245930617c9bd85330c78e1a70775e1f61b12f7a (patch) | |
tree | aa6efdbb215c654ff0046b8c4245b008253a9de1 /fs/f2fs/super.c | |
parent | 31f85ccc84b82cc7eb122af01f5017fbe1e29289 (diff) | |
download | linux-245930617c9bd85330c78e1a70775e1f61b12f7a.tar.xz |
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.c | 4 |
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); |