From: NeilBrown <neilb@suse.com>
To: Shaohua Li <shli@fb.com>, linux-raid@vger.kernel.org
Cc: Kernel-team@fb.com
Subject: Re: [PATCH] raid5: guarantee enough stripes to avoid reshape hang
Date: Wed, 31 Aug 2016 18:05:23 +1000 [thread overview]
Message-ID: <87shtlcqik.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <e855bdf2ccb11e440191e9512de460f3c5355dd2.1472578078.git.shli@fb.com>
[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]
On Wed, Aug 31 2016, Shaohua Li wrote:
> If there aren't enough stripes, reshape will hang. We have a check for
> this in new reshape, but miss it for reshape resume, hence we could see
> hang in reshape resume. This patch forces enough stripes existed if
> reshape resumes.
>
> Signed-off-by: Shaohua Li <shli@fb.com>
I'm really surprised that this was missing, but it certainly appears
that it was.
Reviewed-by: NeilBrown <neilb@suse.com>
thanks!
NeilBrown
> ---
> drivers/md/raid5.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 62febe8..2fdb97b 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -6639,6 +6639,16 @@ static struct r5conf *setup_conf(struct mddev *mddev)
> }
>
> conf->min_nr_stripes = NR_STRIPES;
> + if (mddev->reshape_position != MaxSector) {
> + int stripes = max_t(int,
> + ((mddev->chunk_sectors << 9) / STRIPE_SIZE) * 4,
> + ((mddev->new_chunk_sectors << 9) / STRIPE_SIZE) * 4);
> + conf->min_nr_stripes = max(NR_STRIPES, stripes);
> + if (conf->min_nr_stripes != NR_STRIPES)
> + printk(KERN_INFO
> + "md/raid:%s: force stripe size %d for reshape\n",
> + mdname(mddev), conf->min_nr_stripes);
> + }
> memory = conf->min_nr_stripes * (sizeof(struct stripe_head) +
> max_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024;
> atomic_set(&conf->empty_inactive_list_nr, NR_STRIPE_HASH_LOCKS);
> --
> 2.8.0.rc2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
prev parent reply other threads:[~2016-08-31 8:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 17:29 [PATCH] raid5: guarantee enough stripes to avoid reshape hang Shaohua Li
2016-08-31 8:05 ` NeilBrown [this message]
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=87shtlcqik.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=Kernel-team@fb.com \
--cc=linux-raid@vger.kernel.org \
--cc=shli@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