]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: improve verbose logging when including old devices.
authorNeilBrown <neilb@suse.de>
Thu, 22 Mar 2012 03:52:21 +0000 (14:52 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 22 Mar 2012 03:52:21 +0000 (14:52 +1100)
Reporting:

mdadm: added /dev/loop1 to /dev/md0 as 1
mdadm: added /dev/loop2 to /dev/md0 as 2
mdadm: added /dev/loop0 to /dev/md0 as 0
mdadm: /dev/md0 has been started with 2 drives (out of 3).

is confusing - why only 2?  Code now reports:

mdadm: added /dev/loop1 to /dev/md0 as 1
mdadm: added /dev/loop2 to /dev/md0 as 2 (possibly out of date)
mdadm: added /dev/loop0 to /dev/md0 as 0
mdadm: /dev/md0 has been started with 2 drives (out of 3).

which is somewhat clearer.

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

index fadacf5f7e9cbbe9b338edb6c4c10b98ac1e317c..23695e75348c19dafe331dd322374444b2b4da37 100644 (file)
@@ -1334,9 +1334,11 @@ int Assemble(struct supertype *st, char *mddev,
                                                sparecnt--;
                                } else if (verbose > 0)
                                        fprintf(stderr, Name ": added %s "
-                                                       "to %s as %d\n",
+                                                       "to %s as %d%s\n",
                                                devices[j].devname, mddev,
-                                               devices[j].i.disk.raid_disk);
+                                               devices[j].i.disk.raid_disk,
+                                               devices[j].uptodate?"":
+                                               " (possibly out of date)");
                        } else if (verbose > 0 && i < content->array.raid_disks)
                                fprintf(stderr, Name ": no uptodate device for "
                                                "slot %d of %s\n",