]> www.infradead.org Git - users/jedix/linux-maple.git/commit
f2fs: fix changing cursegs if recovery fails on zoned device
authorSheng Yong <shengyong@oppo.com>
Thu, 21 Nov 2024 08:26:56 +0000 (16:26 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 21 Nov 2024 16:13:53 +0000 (16:13 +0000)
commit1015035609e4ccb32e967015a600e01158377dfc
tree3e27af525888edd6e5a74e4761ddfb42f286efa8
parenta35749b1ed64ec7f4df0364fcc6002082d366486
f2fs: fix changing cursegs if recovery fails on zoned device

Fsync data recovery attempts to check and fix write pointer consistency
of cursegs and all other zones. If the write pointers of cursegs are
unaligned, cursegs are changed to new sections.

If recovery fails, zone write pointers are still checked and fixed,
but the latest checkpoint cannot be written back. Additionally, retry-
mount skips recovery and rolls back to reuse the old cursegs whose
zones are already finished. This can lead to unaligned write later.

This patch addresses the issue by leaving writer pointers untouched if
recovery fails. When retry-mount is performed, cursegs and other zones
are checked and fixed after skipping recovery.

Signed-off-by: Song Feng <songfeng@oppo.com>
Signed-off-by: Yongpeng Yang <yangyongpeng1@oppo.com>
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/recovery.c
fs/f2fs/segment.c
fs/f2fs/super.c