]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Create: over-ride "start_ro" setting when creating an array.
authorNeilBrown <neilb@suse.de>
Wed, 15 May 2013 01:40:27 +0000 (11:40 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 15 May 2013 01:40:27 +0000 (11:40 +1000)
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>
Create.c

index e7ed09b40254b8cac985d38ca42c752b2158440b..fe1d4e971b4b353cda69f15a68d9322a5c857e91 100644 (file)
--- 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);