From: NeilBrown Date: Tue, 17 Nov 2009 02:15:34 +0000 (+1100) Subject: Don't silently map --re-add to --add X-Git-Tag: mdadm-3.1.1~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=751fd6c093815e10b2e0d56a920d8ee09ac01c58;p=thirdparty%2Fmdadm.git Don't silently map --re-add to --add As --add can destroy important data on a disk, and --re-add is not suppose to, it is wrong to silently try --add if --re-add fails. So print a message and abort instead. Signed-off-by: NeilBrown --- diff --git a/Manage.c b/Manage.c index 6b8cff48..fb9b9723 100644 --- a/Manage.c +++ b/Manage.c @@ -578,6 +578,12 @@ int Manage_subdevs(char *devname, int fd, /* fall back on normal-add */ } } + if (dv->re_add) { + fprintf(stderr, Name + ": --re-add for %s to %s is not possible\n", + dv->devname, devname); + return 1; + } } else { /* non-persistent. Must ensure that new drive * is at least array.size big.