linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Shaohua Li <shli@fb.com>
Cc: linux-raid@vger.kernel.org, Kernel-team@fb.com,
	songliubraving@fb.com, hch@infradead.org,
	dan.j.williams@intel.com
Subject: Re: [PATCH v3 5/8] md: don't allow resize/reshape with cache support
Date: Thu, 18 Jun 2015 11:16:17 +1000	[thread overview]
Message-ID: <20150618111617.784b0b54@home.neil.brown.name> (raw)
In-Reply-To: <818a40768c716d0d553d55a7cc7b382ebcd7d036.1433356864.git.shli@fb.com>

On Wed, 3 Jun 2015 15:48:40 -0700
Shaohua Li <shli@fb.com> wrote:

> If cache support is enabled, don't allow resize/reshape in current
> stage. In the future, we can flush all data from cache to raid before
> resize/reshape and then allow resize/reshape.
> 
> Signed-off-by: Shaohua Li <shli@fb.com>
> ---
>  drivers/md/raid5.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 26561d8..29f49c7 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -7207,6 +7207,10 @@ static int raid5_resize(struct mddev *mddev, sector_t sectors)
>  	 * worth it.
>  	 */
>  	sector_t newsize;
> +	struct r5conf *conf = mddev->private;
> +
> +	if (conf->cache)
> +		return -EINVAL;
>  	sectors &= ~((sector_t)mddev->chunk_sectors - 1);
>  	newsize = raid5_size(mddev, sectors, mddev->raid_disks);
>  	if (mddev->external_size &&
> @@ -7258,6 +7262,8 @@ static int check_reshape(struct mddev *mddev)
>  {
>  	struct r5conf *conf = mddev->private;
>  
> +	if (conf->cache)
> +		return -EINVAL;
>  	if (mddev->delta_disks == 0 &&
>  	    mddev->new_layout == mddev->layout &&
>  	    mddev->new_chunk_sectors == mddev->chunk_sectors)

This patch should come before that patch which enables caches - the
could should be correct at each point in the series.

NeilBrown

  reply	other threads:[~2015-06-18  1:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 22:48 [PATCH v3 0/8] MD: a caching layer for raid5/6 Shaohua Li
2015-06-03 22:48 ` [PATCH v3 1/8] MD: add a new disk role to present cache device Shaohua Li
2015-06-17 23:32   ` Neil Brown
2015-06-03 22:48 ` [PATCH v3 2/8] raid5: directly use mddev->queue Shaohua Li
2015-06-03 22:48 ` [PATCH v3 4/8] raid5: add some sysfs entries Shaohua Li
2015-06-03 22:48 ` [PATCH v3 5/8] md: don't allow resize/reshape with cache support Shaohua Li
2015-06-18  1:16   ` Neil Brown [this message]
2015-06-03 22:48 ` [PATCH v3 6/8] raid5: skip resync if caching is enabled Shaohua Li
2015-06-03 22:48 ` [PATCH v3 7/8] raid5: guarantee cache release stripes in correct way Shaohua Li
2015-06-03 22:48 ` [PATCH v3 8/8] raid5: multi-thread support for raid5 caching reclaim Shaohua Li
2015-06-04 19:29 ` Fwd: [PATCH v3 0/8] MD: a caching layer for raid5/6 Davor Vusir
     [not found] ` <c6df8779f11a4dc3362a04e7cee0be2aec213ebe.1433356864.git.shli@fb.com>
2015-06-18  1:00   ` [PATCH v3 3/8] raid5: A caching layer for RAID5/6 Neil Brown
2015-06-18  5:24     ` Shaohua Li

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=20150618111617.784b0b54@home.neil.brown.name \
    --to=neilb@suse.de \
    --cc=Kernel-team@fb.com \
    --cc=dan.j.williams@intel.com \
    --cc=hch@infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=songliubraving@fb.com \
    /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;
as well as URLs for NNTP newsgroup(s).