Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f0905ec authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: remove conflicting check for minimum number of devices in raid56



The device removal code was incorrectly checking against two different limits for
raid5 and raid6.

Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 10e78e3a
Loading
Loading
Loading
Loading
+0 −8
Original line number Original line Diff line number Diff line
@@ -1392,14 +1392,6 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
	}
	}
	btrfs_dev_replace_unlock(&root->fs_info->dev_replace);
	btrfs_dev_replace_unlock(&root->fs_info->dev_replace);


	if ((all_avail & (BTRFS_BLOCK_GROUP_RAID5 |
			  BTRFS_BLOCK_GROUP_RAID6) && num_devices <= 3)) {
		printk(KERN_ERR "btrfs: unable to go below three devices "
		       "on raid5 or raid6\n");
		ret = -EINVAL;
		goto out;
	}

	if ((all_avail & BTRFS_BLOCK_GROUP_RAID10) && num_devices <= 4) {
	if ((all_avail & BTRFS_BLOCK_GROUP_RAID10) && num_devices <= 4) {
		printk(KERN_ERR "btrfs: unable to go below four devices "
		printk(KERN_ERR "btrfs: unable to go below four devices "
		       "on raid10\n");
		       "on raid10\n");