Commit e3176ca2 authored by Ilya Dryomov's avatar Ilya Dryomov

Btrfs: stop silently switching single chunks to raid0 on balance

This has been causing a lot of confusion for quite a while now and a lot
of users were surprised by this (some of them were even stuck in a
ENOSPC situation which they couldn't easily get out of).  The addition
of restriper gives users a clear choice between raid0 and drive concat
setup so there's absolutely no excuse for us to keep doing this.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent ea466794
...@@ -6941,7 +6941,6 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags) ...@@ -6941,7 +6941,6 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags)
if (flags & (BTRFS_BLOCK_GROUP_RAID1 | if (flags & (BTRFS_BLOCK_GROUP_RAID1 |
BTRFS_BLOCK_GROUP_RAID10)) BTRFS_BLOCK_GROUP_RAID10))
return stripped | BTRFS_BLOCK_GROUP_DUP; return stripped | BTRFS_BLOCK_GROUP_DUP;
return flags;
} else { } else {
/* they already had raid on here, just return */ /* they already had raid on here, just return */
if (flags & stripped) if (flags & stripped)
...@@ -6954,9 +6953,9 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags) ...@@ -6954,9 +6953,9 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags)
if (flags & BTRFS_BLOCK_GROUP_DUP) if (flags & BTRFS_BLOCK_GROUP_DUP)
return stripped | BTRFS_BLOCK_GROUP_RAID1; return stripped | BTRFS_BLOCK_GROUP_RAID1;
/* turn single device chunks into raid0 */ /* this is drive concat, leave it alone */
return stripped | BTRFS_BLOCK_GROUP_RAID0;
} }
return flags; return flags;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment