All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] fsck.f2fs: update kernel version in superblock on forced check
@ 2021-05-01 13:52 Michael Lass
  2021-05-08  6:10 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Lass @ 2021-05-01 13:52 UTC (permalink / raw
  To: linux-f2fs-devel

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 <bevan@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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH] fsck.f2fs: update kernel version in superblock on forced check
  2021-05-01 13:52 [f2fs-dev] [PATCH] fsck.f2fs: update kernel version in superblock on forced check Michael Lass
@ 2021-05-08  6:10 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2021-05-08  6:10 UTC (permalink / raw
  To: Michael Lass, linux-f2fs-devel

On 2021/5/1 21:52, Michael Lass wrote:
> 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 <bevan@bi-co.net>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-08  6:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-01 13:52 [f2fs-dev] [PATCH] fsck.f2fs: update kernel version in superblock on forced check Michael Lass
2021-05-08  6:10 ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.