aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-12-29 20:08:50 -0500
committerNeilBrown <neilb@suse.de>2009-12-29 23:20:12 -0500
commit0f9552b5dc4fe10da37fa3f4a4ca185d90fa41c9 (patch)
tree14f29af551fc226dc4451f1089d4f08dc2611c0d /drivers/md
parentcbd1998377504df005302ac90d49db72a48552a6 (diff)
md: fix small irregularity with start_ro module parameter
The start_ro modules parameter can be used to force arrays to be started in 'auto-readonly' in which they are read-only until the first write. This ensures that no resync/recovery happens until something else writes to the device. This is important for resume-from-disk off an md array. However if an array is started 'readonly' (by writing 'readonly' to the 'array_state' sysfs attribute) we want it to be really 'readonly', not 'auto-readonly'. So strengthen the condition to only set auto-readonly if the array is not already read-only. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7862231a0750..d2aff7209070 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4357,7 +4357,7 @@ static int do_md_run(mddev_t * mddev)
4357 mddev->barriers_work = 1; 4357 mddev->barriers_work = 1;
4358 mddev->ok_start_degraded = start_dirty_degraded; 4358 mddev->ok_start_degraded = start_dirty_degraded;
4359 4359
4360 if (start_readonly) 4360 if (start_readonly && mddev->ro == 0)
4361 mddev->ro = 2; /* read-only, but switch on first write */ 4361 mddev->ro = 2; /* read-only, but switch on first write */
4362 4362
4363 err = mddev->pers->run(mddev); 4363 err = mddev->pers->run(mddev);