->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>
if (mddev_trylock(mddev)) {
int spares = 0;
- if (mddev->safemode == 1)
+ if (!mddev->external && mddev->safemode == 1)
mddev->safemode = 0;
if (mddev->ro) {