md: avoid possible spinning md thread at shutdown.
authorNeilBrown <neilb@suse.de>
Mon, 5 May 2014 23:36:08 +0000 (09:36 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 17:28:12 +0000 (10:28 -0700)
commit0bc4091108e8f2e65faef3082e5261f2c35cd2b4
tree317cbe7293c672990afb88138a3855a1533a5c05
parent8c7311a1c4a8d804bde91b00a2f2c1a22a954c30
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c