f2fs: fix write pointers on zoned device after roll forward
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 2 Dec 2023 08:08:57 +0000 (00:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:26 +0000 (20:14 +0000)
[ Upstream commit 9dad4d964291295ef48243d4e03972b85138bc9f ]

1. do roll forward recovery
2. update current segments pointers
3. fix the entire zones' write pointers
4. do checkpoint

Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/recovery.c

index f0de36e..c8ba9f1 100644 (file)
@@ -917,6 +917,8 @@ skip:
        if (!err && fix_curseg_write_pointer && !f2fs_readonly(sbi->sb) &&
                        f2fs_sb_has_blkzoned(sbi)) {
                err = f2fs_fix_curseg_write_pointer(sbi);
+               if (!err)
+                       err = f2fs_check_write_pointer(sbi);
                ret = err;
        }