]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Detail: report correct raid-disk for removed drives.
authorNeilBrown <neilb@suse.com>
Fri, 18 Dec 2015 02:49:30 +0000 (13:49 +1100)
committerNeilBrown <neilb@suse.com>
Fri, 18 Dec 2015 02:49:30 +0000 (13:49 +1100)
Back in
  Commit: 8057db46a15d ("Detail: fix handling of 'disks' array.")
when we doubled the size of the 'disks' array to handle primary and
replacement, we should have halved the setting of the default raid_disk
number.

Reported-by: Coly Li <colyli@suse.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Detail.c

index 200f65faced93f1fa30364ca97908d789195c3a9..cbf1f9ad9430e407ae9a773e60aeca1daf72000a 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -299,7 +299,7 @@ int Detail(char *dev, struct context *c)
        for (d = 0; d < max_disks * 2; d++) {
                disks[d].state = (1<<MD_DISK_REMOVED);
                disks[d].major = disks[d].minor = 0;
-               disks[d].number = disks[d].raid_disk = d;
+               disks[d].number = disks[d].raid_disk = d/2;
        }
 
        next = array.raid_disks*2;