fsck.f2fs: do not roll forward a checkpoint-disabled image
With checkpoint=disable, the kernel does not write a checkpoint at
umount. The last checkpoint is the one written when checkpoint was
disabled, with CP_DISABLED_FLAG set and without CP_UMOUNT_FLAG. The
kernel never rolls forward such an image: f2fs_fill_super() skips the
recovery when CP_DISABLED_FLAG is set, and drops all writes after the
checkpoint.
fsck decides to record fsync data only by CP_UMOUNT_FLAG, so it walks
the warm node chain of an image that the kernel will not recover. While
checkpoint is disabled, SSR reuses blocks written and invalidated after
the checkpoint, so the chain can point back to a block written earlier
in the same session with the same cp_ver. fsck then reports "detect
looped node chain" and fails. xfstests generic/320 and generic/642 hit
this almost every time with checkpoint=disable.
Skip recording fsync data when CP_DISABLED_FLAG is set, as the kernel
does.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 file changed