diff options
author | NeilBrown <neilb@suse.de> | 2010-12-01 01:47:32 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-01 01:47:32 +0100 |
commit | 87f26d14f75cf565a5885b2a3426499a48987ac3 (patch) | |
tree | b68e93ac398edf4fc31ea5e2152155e1258391c2 /Assemble.c | |
parent | fix: assemble for external metadata generates segfault if invalid device found (diff) | |
download | mdadm-87f26d14f75cf565a5885b2a3426499a48987ac3.tar.xz mdadm-87f26d14f75cf565a5885b2a3426499a48987ac3.zip |
Assemble: allow an array undergoing reshape to be started without backup file
Though not having the proper backup file can cause data corruption, it
is not enough to justify not being able to start the array at all.
So allow "--invalid-backup" to be specified which says "just continue
even if a backup cannot be restored".
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r-- | Assemble.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -133,7 +133,8 @@ static int ident_matches(struct mddev_ident *ident, int Assemble(struct supertype *st, char *mddev, struct mddev_ident *ident, - struct mddev_dev *devlist, char *backup_file, + struct mddev_dev *devlist, + char *backup_file, int invalid_backup, int readonly, int runstop, char *update, char *homehost, int require_homehost, int verbose, int force) @@ -1097,8 +1098,16 @@ int Assemble(struct supertype *st, char *mddev, } else fdlist[i] = -1; } - if (!err) - err = Grow_restart(st, content, fdlist, bestcnt, backup_file, verbose > 0); + if (!err) { + err = Grow_restart(st, content, fdlist, bestcnt, + backup_file, verbose > 0); + if (err && invalid_backup) { + if (verbose > 0) + fprintf(stderr, Name ": continuing" + " without restoring backup\n"); + err = 0; + } + } while (i>0) { i--; if (fdlist[i]>=0) close(fdlist[i]); |