]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Incremental: don't be distracted by partition table when calling try_spare.
authorNeilBrown <neilb@suse.de>
Wed, 5 Nov 2014 05:21:42 +0000 (16:21 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 5 Nov 2014 05:21:42 +0000 (16:21 +1100)
Currently a partition table on a device makes "mdadm -I" think
the array has a particular metadata type and so will only
add it to an array of that (partition table) type .. which doesn't
make any sense.

So tell guess_super to only look for 'array' metadata.

Reported-by: Caspar Smit <c.smit@truebit.nl>
Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c

index c9372587f518dc57693b1d04d746a723423e57b2..13b68bc0adea3fb86038fd7f1d4d13dcab0a1b90 100644 (file)
@@ -196,13 +196,13 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
        policy = disk_policy(&dinfo);
        have_target = policy_check_path(&dinfo, &target_array);
 
        policy = disk_policy(&dinfo);
        have_target = policy_check_path(&dinfo, &target_array);
 
-       if (st == NULL && (st = guess_super(dfd)) == NULL) {
+       if (st == NULL && (st = guess_super_type(dfd, guess_array)) == NULL) {
                if (c->verbose >= 0)
                        pr_err("no recognisable superblock on %s.\n",
                               devname);
                rv = try_spare(devname, &dfd, policy,
                               have_target ? &target_array : NULL,
                if (c->verbose >= 0)
                        pr_err("no recognisable superblock on %s.\n",
                               devname);
                rv = try_spare(devname, &dfd, policy,
                               have_target ? &target_array : NULL,
-                              st, c->verbose);
+                              NULL, c->verbose);
                goto out;
        }
        st->ignore_hw_compat = 1;
                goto out;
        }
        st->ignore_hw_compat = 1;