diff options
author | NeilBrown <neilb@suse.de> | 2014-05-06 09:36:08 +1000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-06-09 13:29:08 +0100 |
commit | 27d3d94d680fd29fb2a0946e404f9ba3bc524f0d (patch) | |
tree | 8caf0381767df46119b266ab4ddfd6307c8682f3 | |
parent | e058d7cd3fb7328c3d768686e416e873a1bf2e3f (diff) |
md: avoid possible spinning md thread at shutdown.
commit 0f62fb220aa4ebabe8547d3a9ce4a16d3c045f21 upstream.
If an md array with externally managed metadata (e.g. DDF or IMSM)
is in use, then we should not set safemode==2 at shutdown because:
1/ this is ineffective: user-space need to be involved in any 'safemode' handling,
2/ The safemode management code doesn't cope with safemode==2 on external metadata
and md_check_recover enters an infinite loop.
Even at shutdown, an infinite-looping process can be problematic, so this
could cause shutdown to hang.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/md/md.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 2d0544c9273..db4b4a82843 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8122,7 +8122,8 @@ static int md_notify_reboot(struct notifier_block *this, if (mddev_trylock(mddev)) { if (mddev->pers) __md_stop_writes(mddev); - mddev->safemode = 2; + if (mddev->persistent) + mddev->safemode = 2; mddev_unlock(mddev); } need_delay = 1; |