From: NeilBrown <neilb@suse.de>
To: "Dorau, Lukasz" <lukasz.dorau@intel.com>
Cc: "Baldysiak, Pawel" <pawel.baldysiak@intel.com>,
"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: [PATCH] imsm: fix checking completion of RAID10 resync
Date: Mon, 5 Aug 2013 15:43:59 +1000 [thread overview]
Message-ID: <20130805154359.7a85d2d0@notabene.brown> (raw)
In-Reply-To: <D9FFE20C522965449E182ACE73889AEB1A5381ED@IRSMSX105.ger.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]
On Thu, 1 Aug 2013 12:32:50 +0000 "Dorau, Lukasz" <lukasz.dorau@intel.com>
wrote:
>
> There is another, more serious, problem.
> When we stop the array during initial resync (mdadm -Ss)
> and the function is_resync_complete() is entered for the last time,
> array->array.raid_disks already equals 0, because it is zero'ed by manager:
> a->info.array.raid_disks = mdstat->raid_disks;
> at managemon.c:454.
> As a result sync_size equals 0 and is_resync_complete() incorrectly returns 1 and resync finishes...
>
> It seems to be a race condition between monitor and manager - manager changes value of array.raid_disks too fast.
Yes - that is a serious problem. Thanks for reporting it.
I think this is the correct fix.
Thanks,
NeilBrown
From e49a8a80265ab2150c96b636450f5825bcd69d4a Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 5 Aug 2013 15:40:16 +1000
Subject: [PATCH] mdmon: don't use 'ghost' values from an inactive array.
It is possible for mdmon to see (in /proc/mdstat) and array
in 'inactive' state, "mdadm -S" has written "inactive" to
"array_state".
In this state values such as "raid_disk" are not meaningful
and so should be ignored by manage_member().
Reported-by: "Dorau, Lukasz" <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/managemon.c b/managemon.c
index c245655..f40bbdb 100644
--- a/managemon.c
+++ b/managemon.c
@@ -450,9 +450,11 @@ static void manage_member(struct mdstat_ent *mdstat,
/* Raced with something */
return;
- // FIXME
- a->info.array.raid_disks = mdstat->raid_disks;
- // MORE
+ if (mdstat->active) {
+ // FIXME
+ a->info.array.raid_disks = mdstat->raid_disks;
+ // MORE
+ }
if (sysfs_get_ll(&a->info, NULL, "component_size", &component_size) >= 0)
a->info.component_size = component_size << 1;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2013-08-05 5:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-30 13:59 [PATCH] imsm: fix checking completion of RAID10 resync Pawel Baldysiak
2013-07-30 23:22 ` NeilBrown
2013-08-01 8:46 ` Dorau, Lukasz
2013-08-01 12:32 ` Dorau, Lukasz
2013-08-05 5:43 ` NeilBrown [this message]
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=20130805154359.7a85d2d0@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=lukasz.dorau@intel.com \
--cc=pawel.baldysiak@intel.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).