summaryrefslogtreecommitdiff
path: root/Create.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-05-15 11:40:27 +1000
committerNeilBrown <neilb@suse.de>2013-05-15 11:40:27 +1000
commita21e848a5578793a5ab6518390433b020785af3b (patch)
tree6fb7f3d01468e80f399f37e054a6a95c32ccdf8b /Create.c
parent701d5b4ab5ad72f8998d4398d5b209fea877ce37 (diff)
Create: over-ride "start_ro" setting when creating an array.
If module parameter start_ro is set, arrays start readonly. This is OK when assembling, but is very surprising when creating an array as the resync won't start. So over-ride the setting (unless --read-only was given) make arrays RW when created. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Create.c b/Create.c
index e7ed09b4..fe1d4e97 100644
--- a/Create.c
+++ b/Create.c
@@ -1027,6 +1027,11 @@ int Create(struct supertype *st, char *mddev,
ioctl(mdfd, STOP_ARRAY, NULL);
goto abort;
}
+ /* if start_ro module parameter is set, array is
+ * auto-read-only, which is bad as the resync won't
+ * start. So lets make it read-write now.
+ */
+ ioctl(mdfd, RESTART_ARRAY_RW, NULL);
}
if (c->verbose >= 0)
pr_err("array %s started.\n", mddev);