linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Shaohua Li <shli@kernel.org>
Cc: Guoqing Jiang <gqjiang@suse.com>,
	linux-raid@vger.kernel.org, shli@fb.com
Subject: Re: [PATCH V3] md: move bitmap_destroy before __md_stop
Date: Fri, 10 Mar 2017 13:12:20 +1100	[thread overview]
Message-ID: <87h931hocb.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20170310010604.lpyhnmnlcy5w3xmi@kernel.org>

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

On Thu, Mar 09 2017, Shaohua Li wrote:

> On Fri, Mar 10, 2017 at 11:51:09AM +1100, Neil Brown wrote:
>> On Thu, Mar 09 2017, Shaohua Li wrote:
....
>> > I think it's ok to add this part into bitmap_destroy, as we need to call
>> > bitmap_destroy before mddev_detach. Look at the usage of mddev_detach, at in
>> > one place (level_store()), we wait for the IO without bitmap_destroy. I think
>> > we should keep this part code in mddev_detach. Maybe create a small function,
>> > let both mddev_detach and bitmap_destroy call it.
>> 
>> I don't think level_store() needs to explicitly wait for behind io.
>> It calls mddev_suspend(), which calls the ->quiesce function in the
>> personality, which is responsible for waiting for all pending IO,
>> including behind.  raid1.c does this correctly.
>
> Can you elaborate Where >quiesce waits for behind IO in raid1? It's not
> obvious. It really should though.

Ahh - you are correct.
allow_barrier() is called by call_bio_endio(), which can be called
before behind-writes complete.

My bi_phys_segments series actually fixed that, by counting every write
request in nr_pending so that nr_pending wouldn't drop to zero until all
the writes had completed.

We should probably come up with a simple fix for -stable.

Unfortunately it doesn't look at all easy.
I'll revisit my bi_phys_segments series next week and try to sort out
the best way to fix this issue.

NeilBrown

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

  reply	other threads:[~2017-03-10  2:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08  2:31 [PATCH V3] md: move bitmap_destroy before __md_stop Guoqing Jiang
2017-03-09 18:24 ` Shaohua Li
2017-03-10  0:51   ` NeilBrown
2017-03-10  1:06     ` Shaohua Li
2017-03-10  2:12       ` NeilBrown [this message]
2017-03-10  2:51   ` Guoqing Jiang

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=87h931hocb.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=gqjiang@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=shli@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).