NeilBrown: Don't silently map --re-add to --add
Martin F. Krafft
madduck at alioth.debian.org
Wed Jan 27 02:02:41 UTC 2010
Module: mdadm
Branch: master
Commit: 751fd6c093815e10b2e0d56a920d8ee09ac01c58
URL: http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=751fd6c093815e10b2e0d56a920d8ee09ac01c58
Author: NeilBrown <neilb at suse.de>
Date: Tue Nov 17 13:15:34 2009 +1100
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 <neilb at suse.de>
---
Manage.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Manage.c b/Manage.c
index 6b8cff4..fb9b972 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.
More information about the pkg-mdadm-commits
mailing list