summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-checker.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/tree-checker.c')
-rw-r--r--fs/btrfs/tree-checker.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 00ab4e783b9f..d7f4a3468945 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -556,6 +556,13 @@ int btrfs_check_chunk_valid(struct btrfs_fs_info *fs_info,
556 return -EUCLEAN; 556 return -EUCLEAN;
557 } 557 }
558 558
559 if (!is_power_of_2(type & BTRFS_BLOCK_GROUP_PROFILE_MASK) &&
560 (type & BTRFS_BLOCK_GROUP_PROFILE_MASK) != 0) {
561 chunk_err(fs_info, leaf, chunk, logical,
562 "invalid chunk profile flag: 0x%llx, expect 0 or 1 bit set",
563 type & BTRFS_BLOCK_GROUP_PROFILE_MASK);
564 return -EUCLEAN;
565 }
559 if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == 0) { 566 if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == 0) {
560 chunk_err(fs_info, leaf, chunk, logical, 567 chunk_err(fs_info, leaf, chunk, logical,
561 "missing chunk type flag, have 0x%llx one bit must be set in 0x%llx", 568 "missing chunk type flag, have 0x%llx one bit must be set in 0x%llx",