]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
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)
committerNeilBrown <neilb@suse.de>
Thu, 28 Nov 2013 00:00:08 +0000 (11:00 +1100)
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
Cc: stable@vger.kernel.org (3.12)
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index b6b7a2866c9e99533afd59a0a142712f58febe63..e60cebf3f519841d81726f1aee6ef97df6e8da6b 100644 (file)
@@ -7777,7 +7777,7 @@ void md_check_recovery(struct mddev *mddev)
        if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
                return;
        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) ||