aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-05-05 19:36:08 -0400
committerNeilBrown <neilb@suse.de>2014-05-05 19:49:31 -0400
commit0f62fb220aa4ebabe8547d3a9ce4a16d3c045f21 (patch)
tree7357293dea01b968a18a745640c8c15f93061ccc /drivers/md
parentcc13b1d1500656a20e41960668f3392dda9fa6e2 (diff)
md: avoid possible spinning md thread at shutdown.
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. Cc: stable@vger.kernel.org (any kernel) Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8fda38d23e38..237b7e0ddc7a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8516,7 +8516,8 @@ static int md_notify_reboot(struct notifier_block *this,
8516 if (mddev_trylock(mddev)) { 8516 if (mddev_trylock(mddev)) {
8517 if (mddev->pers) 8517 if (mddev->pers)
8518 __md_stop_writes(mddev); 8518 __md_stop_writes(mddev);
8519 mddev->safemode = 2; 8519 if (mddev->persistent)
8520 mddev->safemode = 2;
8520 mddev_unlock(mddev); 8521 mddev_unlock(mddev);
8521 } 8522 }
8522 need_delay = 1; 8523 need_delay = 1;