]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Don't silently map --re-add to --add
authorNeilBrown <neilb@suse.de>
Tue, 17 Nov 2009 02:15:34 +0000 (13:15 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 17 Nov 2009 02:15:34 +0000 (13:15 +1100)
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 <neilb@suse.de>
Manage.c

index 6b8cff48c333a69e0ad07659d39bd7de72c0c41d..fb9b9723bac28d0f9e8df72f2035729fe34a0004 100644 (file)
--- 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.