Skip to contentSkip to conversation

fsck.f2fs: update kernel version in superblock on forced check

PATCH In review Michael Lass 2 participants 2 messages May 1, 2021 – May 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsck.f2fs: update kernel version in superblock on forced check

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.

---
 fsck/mount.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fsck/mount.c +4 -3
index 6b2f17e..cc140a3 100644
@@ -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;
Signature · 8 lines
2.31.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Michael Lass

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.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel