diff --git a/drivers/md/md.c b/drivers/md/md.c index 13dd7b276150..fc33082d5ffd 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2725,9 +2725,9 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) break; case read_auto: if (mddev->pers) { - if (mddev->ro != 1) + if (mddev->ro == 0) err = do_md_stop(mddev, 1, 0); - else + else if (mddev->ro == 1) err = restart_array(mddev); if (err == 0) { mddev->ro = 2;