Linux RAID subsystem development
 help / color / mirror / Atom feed
From: "John Z." <md2sf@mail.com>
To: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: FW: [PATCH 008 of 9] md: Fix possible raid1/raid10 deadlock on read error during resync.
Date: Mon, 24 Mar 2008 13:49:03 -0500	[thread overview]
Message-ID: <20080324184903.D9213103C6@ws1-3.us4.outblaze.com> (raw)


> 
> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org
> [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of NeilBrown
> Sent: Sunday, March 02, 2008 5:18 PM
> To: Andrew Morton
> Cc: linux-raid@vger.kernel.org; linux-kernel@vger.kernel.org; K.Tanaka
> Subject: [PATCH 008 of 9] md: Fix possible raid1/raid10 deadlock on read
> error during resync.
> 

> diff .prev/drivers/md/raid1.c ./drivers/md/raid1.c
> --- .prev/drivers/md/raid1.c	2008-03-03 11:03:39.000000000 +1100
> +++ ./drivers/md/raid1.c	2008-03-03 09:56:52.000000000 +1100
> @@ -704,13 +704,20 @@ static void freeze_array(conf_t *conf)
>   	/* stop syncio and normal IO and wait for everything to
>   	 * go quite.
>   	 * We increment barrier and nr_waiting, and then
> -	 * wait until barrier+nr_pending match nr_queued+2
> +	 * wait until nr_pending match nr_queued+1
> +	 * This is called in the context of one normal IO request
> +	 * that has failed. Thus any sync request that might be pending
> +	 * will be blocked by nr_pending, and we need to wait for
> +	 * pending IO requests to complete or be queued for re-try.
> +	 * Thus the number queued (nr_queued) plus this request (1)
> +	 * must match the number of pending IOs (nr_pending) before
> +	 * we continue.
>   	 */
>   	spin_lock_irq(&conf->resync_lock);
>   	conf->barrier++;
>   	conf->nr_waiting++;
>   	wait_event_lock_irq(conf->wait_barrier,
> -			    conf->barrier+conf->nr_pending ==
> conf->nr_queued+2,
> +			    conf->nr_pending == conf->nr_queued+1,
>   			    conf->resync_lock,
>   			    ({ flush_pending_writes(conf);
>   			       raid1_unplug(conf->mddev->queue); }));
> --

When we call freeze_array, it is after reschedule_retry, during which conf->nr_queued is already incremented.
Should we use conf->nr_pending == conf->nr_pending here?




-- 
Want an e-mail address like mine?
Get a free e-mail account today at www.mail.com!


             reply	other threads:[~2008-03-24 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 18:49 John Z. [this message]
2008-03-25  3:41 ` FW: [PATCH 008 of 9] md: Fix possible raid1/raid10 deadlock on read error during resync Neil Brown

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=20080324184903.D9213103C6@ws1-3.us4.outblaze.com \
    --to=md2sf@mail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@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