From a21e848a5578793a5ab6518390433b020785af3b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 15 May 2013 11:40:27 +1000 Subject: [PATCH] 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 --- Create.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Create.c b/Create.c index e7ed09b..fe1d4e9 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);