From: "H. Peter Anvin" <hpa@zytor.com>
To: Chris Mason <chris.mason@fusionio.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: experimental raid5/6 code in git
Date: Mon, 04 Feb 2013 13:42:24 -0800 [thread overview]
Message-ID: <51102B40.6000207@zytor.com> (raw)
In-Reply-To: <20130202160212.GB4694@shiny>
@@ -1389,6 +1392,14 @@ int btrfs_rm_device(struct btrfs_root *root, char
*device_path)
}
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) {
printk(KERN_ERR "btrfs: unable to go below four devices "
"on raid10\n");
@@ -1403,6 +1414,21 @@ int btrfs_rm_device(struct btrfs_root *root, char
*device_path)
goto out;
}
+ if ((all_avail & BTRFS_BLOCK_GROUP_RAID5) &&
+ root->fs_info->fs_devices->rw_devices <= 2) {
+ printk(KERN_ERR "btrfs: unable to go below two "
+ "devices on raid5\n");
+ ret = -EINVAL;
+ goto out;
+ }
+ if ((all_avail & BTRFS_BLOCK_GROUP_RAID6) &&
+ root->fs_info->fs_devices->rw_devices <= 3) {
+ printk(KERN_ERR "btrfs: unable to go below three "
+ "devices on raid6\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
if (strcmp(device_path, "missing") == 0) {
struct list_head *devices;
struct btrfs_device *tmp;
This seems inconsistent?
-hpa
next prev parent reply other threads:[~2013-02-04 21:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-02 16:02 experimental raid5/6 code in git Chris Mason
2013-02-03 17:33 ` Hendrik Friedel
2013-02-04 21:42 ` H. Peter Anvin [this message]
2013-02-05 1:23 ` Chris Mason
2013-02-05 2:26 ` H. Peter Anvin
2013-02-05 2:59 ` Gareth Pye
2013-02-05 5:29 ` Chester
2013-02-05 6:10 ` Gareth Pye
2013-02-05 14:22 ` Tomasz Torcz
2013-02-05 18:32 ` Chris Mason
[not found] ` <CAM_ZMPCAcKtOH4UapR8HbSN6Woi7Lh7mqy+e14TDY+8tM386iQ@mail.gmail.com>
2013-02-11 15:13 ` Chris Mason
2013-02-12 15:16 ` Kaspar Schleiser
2013-02-12 15:30 ` Chris Mason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51102B40.6000207@zytor.com \
--to=hpa@zytor.com \
--cc=chris.mason@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox