linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Nate Dailey <nate.dailey@stratus.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] raid1: include bio_end_io_list in nr_queued to prevent freeze_array hang
Date: Mon, 14 Mar 2016 11:59:41 -0700	[thread overview]
Message-ID: <20160314185941.GA42144@kernel.org> (raw)
In-Reply-To: <20160306233304.GA3200@kernel.org>

On Sun, Mar 06, 2016 at 03:33:04PM -0800, Shaohua Li wrote:
> On Mon, Feb 29, 2016 at 10:43:58AM -0500, Nate Dailey wrote:
> > If raid1d is handling a mix of read and write errors, handle_read_error's
> > call to freeze_array can get stuck.
> > 
> > This can happen because, though the bio_end_io_list is initially drained,
> > writes can be added to it via handle_write_finished as the retry_list
> > is processed. These writes contribute to nr_pending but are not included
> > in nr_queued.
> > 
> > If a later entry on the retry_list triggers a call to handle_read_error,
> > freeze array hangs waiting for nr_pending == nr_queued+extra. The writes
> > on the bio_end_io_list aren't included in nr_queued so the condition will
> > never be satisfied.
> > 
> > To prevent the hang, include bio_end_io_list writes in nr_queued.
> > 
> > There's probably a better way to handle decrementing nr_queued, but this
> > seemed like the safest way to avoid breaking surrounding code.
> > 
> > I'm happy to supply the script I used to repro this hang.
> 
> Looks good. Could you please also fix raid10?

Alright, I applied the patch and added raid10 part so this can be applied to 4.6

  reply	other threads:[~2016-03-14 18:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 15:43 [PATCH] raid1: include bio_end_io_list in nr_queued to prevent freeze_array hang Nate Dailey
2016-03-06 23:33 ` Shaohua Li
2016-03-14 18:59   ` Shaohua Li [this message]
2016-03-17 20:29 ` Joe Lawrence
2016-03-17 21: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=20160314185941.GA42144@kernel.org \
    --to=shli@kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=nate.dailey@stratus.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).