From: NeilBrown <neilb@suse.com>
To: Shaohua Li <shli@kernel.org>
Cc: linux-raid@vger.kernel.org
Subject: Re: [md PATCH 2/3] md: remove md_super_wait() call after bitmap_flush()
Date: Thu, 10 Nov 2016 11:57:35 +1100 [thread overview]
Message-ID: <87bmxom9s0.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20161109205120.kodctkb5xn5x55rd@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]
On Thu, Nov 10 2016, Shaohua Li wrote:
> On Wed, Nov 09, 2016 at 10:21:32AM +1100, Neil Brown wrote:
>> bitmap_flush() finishes with bitmap_update_sb(), and that finishes
>> with write_page(..., 1), so write_page() will wait for all writes
>> to complete. So there is no point calling md_super_wait()
>> immediately afterwards.
>>
>> Signed-off-by: NeilBrown <neilb@suse.com>
>> ---
>> drivers/md/md.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>> index f389d8abe137..1f1c7f007b68 100644
>> --- a/drivers/md/md.c
>> +++ b/drivers/md/md.c
>> @@ -5472,7 +5472,6 @@ static void __md_stop_writes(struct mddev *mddev)
>> del_timer_sync(&mddev->safemode_timer);
>>
>> bitmap_flush(mddev);
>> - md_super_wait(mddev);
>
> bitmap_flush() could be null if there is no bitmap, is this safe?
Good question.
If there is no bitmap, then all metadata updates (both superblock
and bad-block-list) are synchronous in md_update_sb(), which is always
called under ->reconfig_mutex and so which cannot race with this code.
So yes, it is safe. That md_super_wait() was only ever intended to wait
for things that bitmap_flush() might have flushed, so it should have
been inside that function.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
next prev parent reply other threads:[~2016-11-10 0:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 23:21 [md PATCH 0/3] Three unrelated md patches NeilBrown
2016-11-08 23:21 ` [md PATCH 2/3] md: remove md_super_wait() call after bitmap_flush() NeilBrown
2016-11-09 20:51 ` Shaohua Li
2016-11-10 0:57 ` NeilBrown [this message]
2016-11-10 1:13 ` Shaohua Li
2016-11-08 23:21 ` [md PATCH 1/3] md/raid1: fix: IO can block resync indefinitely NeilBrown
2016-11-09 20:50 ` Shaohua Li
2016-11-08 23:21 ` [md PATCH 3/3] md: define mddev flags, recovery flags and r1bio state bits using enums NeilBrown
2016-11-09 20:52 ` 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=87bmxom9s0.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=linux-raid@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.