mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP
[ Upstream commit6f794e3c5c] It appears from the original commit [1] that there isn't any design specific reason not to fail the mount instead of just warning. This patch will change it to fail. [1] commit319e4d0661btrfs: Enhance super validation check Fixes:319e4d0661("btrfs: Enhance super validation check") Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
186a6519dc
commit
3feba59048
@@ -4142,9 +4142,11 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
|
||||
btrfs_err(fs_info, "no valid FS found");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP)
|
||||
btrfs_warn(fs_info, "unrecognized super flag: %llu",
|
||||
if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP) {
|
||||
btrfs_err(fs_info, "unrecognized or unsupported super flag: %llu",
|
||||
btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) {
|
||||
btrfs_err(fs_info, "tree_root level too big: %d >= %d",
|
||||
btrfs_super_root_level(sb), BTRFS_MAX_LEVEL);
|
||||
|
||||
Reference in New Issue
Block a user