diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2012-03-27 17:09:17 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2012-03-27 17:09:17 +0300 |
commit | e8920a640be5d4ebe3fee0670639a81d4ffc904c (patch) | |
tree | 0c999adbdce223ac0365ca98c008da8db7bb7cb3 /fs/btrfs/volumes.c | |
parent | 899c81eac890bcfa5f3636f4c43f68e8393ac1f8 (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.c | 6 |
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, allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID10); - if (!profile_is_valid(bctl->data.target, 1) || + if (!alloc_profile_is_valid(bctl->data.target, 1) || bctl->data.target & ~allowed) { printk(KERN_ERR "btrfs: unable to start balance with target " "data profile %llu\n", @@ -2677,7 +2677,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl, ret = -EINVAL; goto out; } - if (!profile_is_valid(bctl->meta.target, 1) || + if (!alloc_profile_is_valid(bctl->meta.target, 1) || bctl->meta.target & ~allowed) { printk(KERN_ERR "btrfs: unable to start balance with target " "metadata profile %llu\n", @@ -2685,7 +2685,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl, ret = -EINVAL; goto out; } - if (!profile_is_valid(bctl->sys.target, 1) || + if (!alloc_profile_is_valid(bctl->sys.target, 1) || bctl->sys.target & ~allowed) { printk(KERN_ERR "btrfs: unable to start balance with target " "system profile %llu\n", |