md: test mddev->flags more safely in md_check_recovery.
authorNeilBrown <neilb@suse.de>
Wed, 27 Nov 2013 23:34:18 +0000 (10:34 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 19:05:54 +0000 (11:05 -0800)
commit52df633c9c9c92264e04e1ead9290e5192a8768e
treec04de351cbced0480922024083d690da860f7c0e
parent2501e938cf2350ca719e423b3aa30e7303805b7c
md: test mddev->flags more safely in md_check_recovery.

commit 142d44c310819e1965ca70b4d55d7679f5797e25 upstream.

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

When
commit 260fa034ef7a4ff8b7306 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.

https://bugzilla.kernel.org/show_bug.cgi?id=65721

Reported-and-tested-by: Richard W.M. Jones <rjones@redhat.com>
Fixes: 260fa034ef7a4ff8b7306
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c