summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-08-15 01:51:20 +0200
committerNeilBrown <neilb@suse.de>2012-08-15 01:51:20 +0200
commit9cf9a1de36ca37dfc447caf35fbe87967709c40c (patch)
tree244aa2eb86a9aaf0e912c84e7a0726e7026940c3 /Manage.c
parentManage.c: fix make everything compilation error (diff)
downloadmdadm-9cf9a1de36ca37dfc447caf35fbe87967709c40c.tar.xz
mdadm-9cf9a1de36ca37dfc447caf35fbe87967709c40c.zip
Manage: zero metadata before adding to 'external' array.
'external' arrays don't support --re-add yet so old metadata is no value, and 'ddf' gets confusing in mdmon if old metadata is found. So for now, zero out any old metadata found before adding a spare to an externally-managed array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r--Manage.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Manage.c b/Manage.c
index f83af652..7f27f741 100644
--- a/Manage.c
+++ b/Manage.c
@@ -786,6 +786,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
return -1;
}
+ Kill(dv->devname, NULL, 0, -1, 0);
dfd = dev_open(dv->devname, O_RDWR | O_EXCL|O_DIRECT);
if (mdmon_running(tst->container_dev))
tst->update_tail = &tst->updates;