]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Kill.c
imsm: Remove --dump/--restore implementation
[thirdparty/mdadm.git] / Kill.c
diff --git a/Kill.c b/Kill.c
index cc2e589301ee8f201c30e68dcfdac08943e803df..bfd0efdc0b1d463bda64756cb51a2f487ba58de3 100644 (file)
--- a/Kill.c
+++ b/Kill.c
@@ -37,7 +37,8 @@ int Kill(char *dev, struct supertype *st, int force, int verbose, int noexcl)
         * Returns:
         *  0 - a zero superblock was successfully written out
         *  1 - failed to write the zero superblock
-        *  2 - failed to open the device or find a superblock.
+        *  2 - failed to open the device.
+        *  4 - failed to find a superblock.
         */
 
        int fd, rv = 0;
@@ -57,13 +58,13 @@ int Kill(char *dev, struct supertype *st, int force, int verbose, int noexcl)
                if (verbose >= 0)
                        pr_err("Unrecognised md component device - %s\n", dev);
                close(fd);
-               return 2;
+               return 4;
        }
        st->ignore_hw_compat = 1;
        rv = st->ss->load_super(st, fd, dev);
        if (rv == 0 || (force && rv >= 2)) {
                st->ss->free_super(st);
-               st->ss->init_super(st, NULL, 0, "", NULL, NULL,
+               st->ss->init_super(st, NULL, NULL, "", NULL, NULL,
                                   INVALID_SECTORS);
                if (st->ss->store_super(st, fd)) {
                        if (verbose >= 0)
@@ -107,18 +108,18 @@ int Kill_subarray(char *dev, char *subarray, int verbose)
                goto free_super;
        }
 
-       if (is_subarray_active(subarray, st->devname)) {
+       if (is_subarray_active(subarray, st->devnm)) {
                if (verbose >= 0)
                        pr_err("Subarray-%s still active, aborting\n",
                               subarray);
                goto free_super;
        }
 
-       if (mdmon_running(st->devnum))
+       if (mdmon_running(st->devnm))
                st->update_tail = &st->updates;
 
        /* ok we've found our victim, drop the axe */
-       rv = st->ss->kill_subarray(st);
+       rv = st->ss->kill_subarray(st, subarray);
        if (rv) {
                if (verbose >= 0)
                        pr_err("Failed to delete subarray-%s from %s\n",