All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@fusionio.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Chris Mason <clmason@fusionio.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: experimental raid5/6 code in git
Date: Mon, 4 Feb 2013 20:23:16 -0500	[thread overview]
Message-ID: <20130205012316.GB28437@shiny> (raw)
In-Reply-To: <51102B40.6000207@zytor.com>

On Mon, Feb 04, 2013 at 02:42:24PM -0700, H. Peter Anvin wrote:
> @@ -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?

Whoops, missed that one.  Thanks!

-chris


  reply	other threads:[~2013-02-05  1:30 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
2013-02-05  1:23   ` Chris Mason [this message]
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=20130205012316.GB28437@shiny \
    --to=chris.mason@fusionio.com \
    --cc=clmason@fusionio.com \
    --cc=hpa@zytor.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.