diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-02-16 13:23:30 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-02-29 08:34:35 -0800 |
commit | 4d4c5938933186a7eeff80b4f77c98dd583a98ea (patch) | |
tree | ec9cf5233884453745de9cfff078c19dbf71c7db /fs/f2fs/super.c | |
parent | 7af2df0f67a1469762e59be3726a803882d83f6f (diff) |
f2fs: fix write pointers all the time
Even if the roll forward recovery stopped due to any error, we have to fix
the write pointers in order to mount the disk from the previous checkpoint.
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 | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index b36c840b85ae..32c23a0caf04 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4674,11 +4674,14 @@ reset_checkpoint: * If the f2fs is not readonly and fsync data recovery succeeds, * check zoned block devices' write pointer consistency. */ - if (!err && !f2fs_readonly(sb) && f2fs_sb_has_blkzoned(sbi)) { - err = f2fs_check_write_pointer(sbi); - if (err) - goto free_meta; + if (f2fs_sb_has_blkzoned(sbi) && !f2fs_readonly(sb)) { + int err2 = f2fs_check_write_pointer(sbi); + + if (err2) + err = err2; } + if (err) + goto free_meta; f2fs_init_inmem_curseg(sbi); |