]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: ddf_process_update: log offsets for conf changes
authorMartin Wilck <mwilck@arcor.de>
Tue, 30 Jul 2013 21:18:27 +0000 (23:18 +0200)
committerNeilBrown <neilb@suse.de>
Wed, 31 Jul 2013 02:47:44 +0000 (12:47 +1000)
I needed this for tracking a bug with wrong offsets after array
creation.

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

index 20f4cf4cd56b3d064349e15d64065c933a173834..b639f07fe43418c669a9678ae25105b0df2f1587 100644 (file)
@@ -4495,10 +4495,27 @@ static void ddf_process_update(struct supertype *st,
                         * fields
                         */
                        unsigned int i;
+                       unsigned int k;
                        copy_matching_bvd(ddf, &vcl->conf, update);
-                       for (i = 1; i < vc->sec_elmnt_count; i++)
+                       for (k = 0; k < be16_to_cpu(vc->prim_elmnt_count); k++)
+                               dprintf("BVD %u has %08x at %llu\n", 0,
+                                       be32_to_cpu(vcl->conf.phys_refnum[k]),
+                                       be64_to_cpu(LBA_OFFSET(ddf,
+                                                              &vcl->conf)[k]));
+                       for (i = 1; i < vc->sec_elmnt_count; i++) {
                                copy_matching_bvd(ddf, vcl->other_bvds[i-1],
                                                  update);
+                               for (k = 0; k < be16_to_cpu(
+                                            vc->prim_elmnt_count); k++)
+                                       dprintf("BVD %u has %08x at %llu\n", i,
+                                               be32_to_cpu
+                                               (vcl->other_bvds[i-1]->
+                                                phys_refnum[k]),
+                                               be64_to_cpu
+                                               (LBA_OFFSET
+                                                (ddf,
+                                                 vcl->other_bvds[i-1])[k]));
+                       }
                } else {
                        /* A new VD_CONF */
                        unsigned int i;