Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: tree-checker: check remap-tree flags in btrfs_check_chunk_valid()

Add a check to btrfs_check_chunk_valid() that the METADATA_REMAP and
REMAPPED flags are only set if the REMAP_TREE incompat flag is also set.

Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Mark Harmstone and committed by
David Sterba
18addf9e da08c02b

+14
+14
fs/btrfs/tree-checker.c
··· 999 999 } 1000 1000 } 1001 1001 1002 + if (unlikely((type & BTRFS_BLOCK_GROUP_METADATA_REMAP) && 1003 + !(features & BTRFS_FEATURE_INCOMPAT_REMAP_TREE))) { 1004 + chunk_err(fs_info, leaf, chunk, logical, 1005 + "METADATA_REMAP chunk type without REMAP_TREE incompat bit"); 1006 + return -EUCLEAN; 1007 + } 1008 + 1009 + if (unlikely(remapped && 1010 + !(features & BTRFS_FEATURE_INCOMPAT_REMAP_TREE))) { 1011 + chunk_err(fs_info, leaf, chunk, logical, 1012 + "REMAPPED chunk flag without REMAP_TREE incompat bit"); 1013 + return -EUCLEAN; 1014 + } 1015 + 1002 1016 if (!remapped && 1003 1017 !valid_stripe_count(type & BTRFS_BLOCK_GROUP_PROFILE_MASK, 1004 1018 num_stripes, sub_stripes)) {