linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Vaughan <cxt9401@163.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: How does md gurantee not miss to free an active stripe_head when md stops?
Date: Fri, 22 Jul 2016 11:15:47 +1000	[thread overview]
Message-ID: <871t2m8occ.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <004e01d1e274$faa33a20$efe9ae60$@163.com>

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

On Wed, Jul 20 2016, Vaughan wrote:

> Hi Neil,
>
> I'm using v3.10 md code for develop. Recently I encounter a problem where an
> read IO usually returned from physical disk after md has been stopped.
> I reviewed the code and find when md stops, it unregister raid5d
> unconditionally and call shrink_stripes() to free only the *inactive*
> stripes.
> I know before stop, it uses O_EXCL open the md, but that won't stop others
> open it and send IO to it.
> So I think it's possible that some active stripes will be still running.

do_md_stop() calls sync_blockdev() which was supposed to wait for all
outstanding IO.  It probably doesn't wait for reads though, only writes.


>
> And I also found
> commit 5aa61f427e4979be733e4847b9199ff9cc48a47e
> Author: NeilBrown <neilb@suse.de>
> Date:   Mon Dec 15 12:56:57 2014 +1100
>     md: split detach operation out from ->stop.
>
> add calling a quiesce before unregister raid5d in __md_stop, which not
> exists there before.
> Does this fix the hole when md stop?

Why don't you try it and see?

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2016-07-22  1:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 10:53 How does md gurantee not miss to free an active stripe_head when md stops? Vaughan
2016-07-22  1:15 ` NeilBrown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-07-18  9:18 Vaughan

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=871t2m8occ.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=cxt9401@163.com \
    --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;
as well as URLs for NNTP newsgroup(s).