aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2012-03-27 10:09:17 -0400
committerIlya Dryomov <idryomov@gmail.com>2012-03-27 10:09:17 -0400
commite8920a640be5d4ebe3fee0670639a81d4ffc904c (patch)
tree0c999adbdce223ac0365ca98c008da8db7bb7cb3 /fs/btrfs/volumes.c
parent899c81eac890bcfa5f3636f4c43f68e8393ac1f8 (diff)
Btrfs: make profile_is_valid() check more strict
"0" is a valid value for an on-disk chunk profile, but it is not a valid extended profile. (We have a separate bit for single chunks in extended case) Also rename it to alloc_profile_is_valid() for clarity. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 4b263a2009b0..e4ef0f2fdb73 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2669,7 +2669,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
2669 allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 | 2669 allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
2670 BTRFS_BLOCK_GROUP_RAID10); 2670 BTRFS_BLOCK_GROUP_RAID10);
2671 2671
2672 if (!profile_is_valid(bctl->data.target, 1) || 2672 if (!alloc_profile_is_valid(bctl->data.target, 1) ||
2673 bctl->data.target & ~allowed) { 2673 bctl->data.target & ~allowed) {
2674 printk(KERN_ERR "btrfs: unable to start balance with target " 2674 printk(KERN_ERR "btrfs: unable to start balance with target "
2675 "data profile %llu\n", 2675 "data profile %llu\n",
@@ -2677,7 +2677,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
2677 ret = -EINVAL; 2677 ret = -EINVAL;
2678 goto out; 2678 goto out;
2679 } 2679 }
2680 if (!profile_is_valid(bctl->meta.target, 1) || 2680 if (!alloc_profile_is_valid(bctl->meta.target, 1) ||
2681 bctl->meta.target & ~allowed) { 2681 bctl->meta.target & ~allowed) {
2682 printk(KERN_ERR "btrfs: unable to start balance with target " 2682 printk(KERN_ERR "btrfs: unable to start balance with target "
2683 "metadata profile %llu\n", 2683 "metadata profile %llu\n",
@@ -2685,7 +2685,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
2685 ret = -EINVAL; 2685 ret = -EINVAL;
2686 goto out; 2686 goto out;
2687 } 2687 }
2688 if (!profile_is_valid(bctl->sys.target, 1) || 2688 if (!alloc_profile_is_valid(bctl->sys.target, 1) ||
2689 bctl->sys.target & ~allowed) { 2689 bctl->sys.target & ~allowed) {
2690 printk(KERN_ERR "btrfs: unable to start balance with target " 2690 printk(KERN_ERR "btrfs: unable to start balance with target "
2691 "system profile %llu\n", 2691 "system profile %llu\n",