]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: find_vdcr: fix minor bug in debug message
authormwilck@arcor.de <mwilck@arcor.de>
Thu, 25 Jul 2013 18:59:10 +0000 (20:59 +0200)
committerNeilBrown <neilb@suse.de>
Tue, 30 Jul 2013 00:57:13 +0000 (10:57 +1000)
This code could find disk -1. Fixed.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index ae6cdf4dc9a7166d8affdcfd885a1c1ea75ab10d..ac30e4e52d9dbb35d74ad1dced9cc54f29eaee0b 100644 (file)
@@ -1731,7 +1731,7 @@ static struct vd_config *find_vdcr(struct ddf_super *ddf, unsigned int inst,
        struct vcl *v;
 
        for (v = ddf->conflist; v; v = v->next) {
-               unsigned int nsec, ibvd;
+               unsigned int nsec, ibvd = 0;
                struct vd_config *conf;
                if (inst != v->vcnum)
                        continue;
@@ -1763,7 +1763,7 @@ static struct vd_config *find_vdcr(struct ddf_super *ddf, unsigned int inst,
                                       n - nsec*conf->sec_elmnt_count, n_bvd))
                        goto bad;
                dprintf("%s: found disk %u as member %u in bvd %d of array %u\n"
-                       , __func__, n, *n_bvd, ibvd-1, inst);
+                       , __func__, n, *n_bvd, ibvd, inst);
                *vcl = v;
                return conf;
        }