summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-03-10 15:55:47 +1100
committerNeilBrown <neilb@suse.de>2010-03-10 15:55:47 +1100
commitd682f3445c7396b4ffd0328a4f8ed8e742ba2eec (patch)
treec2050cd0f0830bfdc6bcf5baed368832d8667417
parenta847575aa1ff0cffe85a1bf224b284ed6b8e2cc1 (diff)
downloadmdadm-d682f3445c7396b4ffd0328a4f8ed8e742ba2eec.tar.gz
mdadm-d682f3445c7396b4ffd0328a4f8ed8e742ba2eec.tar.xz
mdadm-d682f3445c7396b4ffd0328a4f8ed8e742ba2eec.zip
ddf/intel: zero out old metadata before creating a container.
Matching the functionality already in super0 and super1, when we first create a container, remove any other recognisable metadata to ensure it doesn't cause confusion. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--super-ddf.c6
-rw-r--r--super-intel.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/super-ddf.c b/super-ddf.c
index b1cb268..3feea57 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -2413,8 +2413,12 @@ static int write_init_super_ddf(struct supertype *st)
/* FIXME I need to close the fds! */
return 0;
- } else
+ } else {
+ struct dl *d;
+ for (d = ddf->dlist; d; d=d->next)
+ while (Kill(d->devname, NULL, 0, 1, 1) == 0);
return __write_init_super_ddf(st, 1);
+ }
}
#endif
diff --git a/super-intel.c b/super-intel.c
index b413435..a196ca3 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -3441,8 +3441,12 @@ static int write_init_super_imsm(struct supertype *st)
}
return rv;
- } else
+ } else {
+ struct dl *d;
+ for (d = super->disks; d; d = d->next)
+ Kill(d->devname, NULL, 0, 1, 1);
return write_super_imsm(st->sb, 1);
+ }
}
#endif