In 1126e38 (fsck.f2fs: add --{no-}kernel-check to bypass kernel version diff or
not) the automatic check on a kernel version change was made optional and
disabled by default on non-Android systems. This also disabled the update of
the kernel version stored in the superblock if --kernel-check is not given.
Restore the update in case a full check is forced via -y or -f to properly
reflect the version in the superblock.

Signed-off-by: Michael Lass <be...@bi-co.net>
---
 fsck/mount.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fsck/mount.c b/fsck/mount.c
index 6b2f17e..cc140a3 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -967,12 +967,13 @@ int validate_super_block(struct f2fs_sb_info *sbi, enum 
SB_ADDR sb_addr)
                                        c.sb_version, c.version);
                if (!c.no_kernel_check &&
                                memcmp(c.sb_version, c.version, VERSION_LEN)) {
+                       c.auto_fix = 0;
+                       c.fix_on = 1;
+               }
+               if (c.fix_on) {
                        memcpy(sbi->raw_super->version,
                                                c.version, VERSION_LEN);
                        update_superblock(sbi->raw_super, SB_MASK(sb_addr));
-
-                       c.auto_fix = 0;
-                       c.fix_on = 1;
                }
                print_sb_state(sbi->raw_super);
                return 0;
-- 
2.31.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to