aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-10-12 20:55:12 -0400
committerNeilBrown <neilb@suse.de>2008-10-12 20:55:12 -0400
commit80268ee9270ebe4847365a7426de91d179e870d0 (patch)
tree0f5d10d1cc86b64030d036e6e322b23caf6aec5c /drivers
parentea43ddd8491feccf36267349748ea91b1194481e (diff)
md: Don't try to set an array to 'read-auto' if it is already in that state.
'read-auto' is a variant of 'readonly' which will switch to writable on the first write attempt. Calling do_md_stop to set the array readonly when it is already readonly returns an error. So make sure not to do that. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c4
1 files changed, 2 insertions, 2 deletions
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)
2725 break; 2725 break;
2726 case read_auto: 2726 case read_auto:
2727 if (mddev->pers) { 2727 if (mddev->pers) {
2728 if (mddev->ro != 1) 2728 if (mddev->ro == 0)
2729 err = do_md_stop(mddev, 1, 0); 2729 err = do_md_stop(mddev, 1, 0);
2730 else 2730 else if (mddev->ro == 1)
2731 err = restart_array(mddev); 2731 err = restart_array(mddev);
2732 if (err == 0) { 2732 if (err == 0) {
2733 mddev->ro = 2; 2733 mddev->ro = 2;