Commit 142d44c3 authored by NeilBrown's avatar NeilBrown
Browse files

md: test mddev->flags more safely in md_check_recovery.

commit 7a0a5355 md: Don't test all of mddev->flags at once.
made most tests on mddev->flags safer, but missed one.

commit 260fa034 md: avoid deadlock when dirty buffers during md_stop.
added MD_STILL_CLOSED, this caused md_check_recovery to misbehave.
It can think there is something to do but find nothing.  This can
lead to the md thread spinning during array shutdown.

Reported-and-tested-by: default avatarRichard W.M. Jones <>
Fixes: 260fa034

Cc: (3.12)
Signed-off-by: default avatarNeilBrown <>
parent 0c775d52
......@@ -7777,7 +7777,7 @@ void md_check_recovery(struct mddev *mddev)
if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
if ( ! (
(mddev->flags & ~ (1<<MD_CHANGE_PENDING)) ||
(mddev->flags & MD_UPDATE_SB_FLAGS & ~ (1<<MD_CHANGE_PENDING)) ||
test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
test_bit(MD_RECOVERY_DONE, &mddev->recovery) ||
(mddev->external == 0 && mddev->safemode == 1) ||
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment