From: Martin Wilck Date: Tue, 30 Jul 2013 21:18:26 +0000 (+0200) Subject: DDF: log disk status changes more nicely X-Git-Tag: mdadm-3.3~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a645ee220bbc3134ee56cc2882fec7d9e3aa311;p=thirdparty%2Fmdadm.git DDF: log disk status changes more nicely In particular, include refnum for better tracking. This makes it a little easier for humans to track what happened to which disk. Signed-off-by: Martin Wilck Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index 46262ceb..20f4cf4c 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -4203,7 +4203,8 @@ static void ddf_set_disk(struct active_array *a, int n, int state) ddf_set_updates_pending(ddf); } - dprintf("ddf: set_disk %d to %x\n", n, state); + dprintf("ddf: set_disk %d (%08x) to %x\n", n, + be32_to_cpu(dl->disk.refnum), state); /* Now we need to check the state of the array and update * virtual_disk.entries[n].state. @@ -4803,7 +4804,9 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a, if (d2->state_fd >= 0 && d2->disk.major == dl->major && d2->disk.minor == dl->minor) { - dprintf("%x:%x already in array\n", dl->major, dl->minor); + dprintf("%x:%x (%08x) already in array\n", + dl->major, dl->minor, + be32_to_cpu(dl->disk.refnum)); break; } if (d2) @@ -4883,8 +4886,9 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a, di->container_member = dl->pdnum; di->next = rv; rv = di; - dprintf("%x:%x to be %d at %llu\n", dl->major, dl->minor, - i, pos); + dprintf("%x:%x (%08x) to be %d at %llu\n", + dl->major, dl->minor, + be32_to_cpu(dl->disk.refnum), i, pos); break; } @@ -4945,6 +4949,9 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a, } vc->phys_refnum[i_prim] = ddf->phys->entries[dl->pdnum].refnum; LBA_OFFSET(ddf, vc)[i_prim] = cpu_to_be64(di->data_offset); + dprintf("BVD %u gets %u: %08x at %llu\n", i_sec, i_prim, + be32_to_cpu(vc->phys_refnum[i_prim]), + be64_to_cpu(LBA_OFFSET(ddf, vc)[i_prim])); } *updates = mu; return rv;