From e9e43ec36756c50a5dabf6db52d9bebbccaaa72f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 13 Aug 2009 11:12:54 +1000 Subject: Grow: support restart of new migrations. --- Assemble.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Assemble.c') diff --git a/Assemble.c b/Assemble.c index e75c7e5..3bde9ce 100644 --- a/Assemble.c +++ b/Assemble.c @@ -985,6 +985,8 @@ int Assemble(struct supertype *st, char *mddev, } if (err) { fprintf(stderr, Name ": Failed to restore critical section for reshape, sorry.\n"); + if (backup_file == NULL) + fprintf(stderr," Possibly you needed to specify the --backup-file\n"); close(mdfd); return err; } @@ -1093,7 +1095,18 @@ int Assemble(struct supertype *st, char *mddev, content->array.layout, clean, avail, okcnt) && (okcnt >= req_cnt || start_partial_ok) ))) { - if (ioctl(mdfd, RUN_ARRAY, NULL)==0) { + /* This array is good-to-go. + * If a reshape is in progress then we might need to + * continue monitoring it. In that case we start + * it read-only and let the grow code make it writable. + */ + int rv; + if (content->reshape_active && + content->delta_disks <= 0) + rv = Grow_continue(mdfd, st, content, backup_file); + else + rv = ioctl(mdfd, RUN_ARRAY, NULL); + if (rv == 0) { if (verbose >= 0) { fprintf(stderr, Name ": %s has been started with %d drive%s", mddev, okcnt, okcnt==1?"":"s"); -- cgit