MD: not clear ->safemode for external metadata array
authorShaohua Li <shli@fb.com>
Sat, 12 Aug 2017 03:34:45 +0000 (20:34 -0700)
committerShaohua Li <shli@fb.com>
Sat, 12 Aug 2017 03:42:06 +0000 (20:42 -0700)
->safemode should be triggered by mdadm for external metadaa array, otherwise
array's state confuses mdadm.

Fixes: 33182d15c6bf(md: always clear ->safemode when md_check_recovery gets the mddev lock.)
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c

index e4ba95f6cd59803c3403cb2ab0825843edb291b8..b01e458d31e94ce9eba98b9300366121de550619 100644 (file)
@@ -8656,7 +8656,7 @@ void md_check_recovery(struct mddev *mddev)
        if (mddev_trylock(mddev)) {
                int spares = 0;
 
-               if (mddev->safemode == 1)
+               if (!mddev->external && mddev->safemode == 1)
                        mddev->safemode = 0;
 
                if (mddev->ro) {