fsck.f2fs: allow fsck to fix issues with online resize due to SPO
authorSahitya Tummala <stummala@codeaurora.org>
Tue, 24 Mar 2020 09:12:50 +0000 (14:42 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 24 Mar 2020 15:47:52 +0000 (08:47 -0700)
commit9a31cefa29666a219f8b4d328074a6afe6265c4e
tree86c2b4480bed0b78c1ac7d907fbe44b741bc9451
parent11e4322127af8e47735d497f2b475f67ec937672
fsck.f2fs: allow fsck to fix issues with online resize due to SPO

Add support for new CP flag CP_RESIZEFS_FLAG set during online
resize FS. If SPO happens after SB is updated but CP isn't, then
allow fsck to fix it.

The fsck errors without this fix -
    Info: CKPT version = 6ed7bccb
            Wrong user_block_count(2233856)
    [f2fs_do_mount:3365] Checkpoint is polluted

The subsequent mount failure without this fix -
[   11.294650] F2FS-fs (sda8): Wrong user_block_count: 2233856
[   11.300272] F2FS-fs (sda8): Failed to get valid F2FS checkpoint

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c
include/f2fs_fs.h