Skip to content

Commit d8e6fd5

Browse files
fdmananakdave
authored andcommitted
btrfs: fix removal of raid[56|1c34} incompat flags after removing block group
We are incorrectly dropping the raid56 and raid1c34 incompat flags when there are still raid56 and raid1c34 block groups, not when we do not any of those anymore. The logic just got unintentionally broken after adding the support for the raid1c34 modes. Fix this by clear the flags only if we do not have block groups with the respective profiles. Fixes: 9c90744 ("btrfs: drop incompat bit for raid1c34 after last block group is gone") Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 236ebc2 commit d8e6fd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/btrfs/block-group.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,9 @@ static void clear_incompat_bg_bits(struct btrfs_fs_info *fs_info, u64 flags)
856856
found_raid1c34 = true;
857857
up_read(&sinfo->groups_sem);
858858
}
859-
if (found_raid56)
859+
if (!found_raid56)
860860
btrfs_clear_fs_incompat(fs_info, RAID56);
861-
if (found_raid1c34)
861+
if (!found_raid1c34)
862862
btrfs_clear_fs_incompat(fs_info, RAID1C34);
863863
}
864864
}

0 commit comments

Comments
 (0)