mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-26 19:51:32 +00:00
fsck.f2fs: update kernel version in superblock on forced check
commit91f9db23f6
category: bugfix issue: #I6VAS0 CVE: NA Signed-off-by: DongSenhao <dongsenhao2@huawei.com> --------------------------------------- In1126e38
(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> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
parent
8d2dfb7edd
commit
be44193e03
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user