summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2002-04-04 01:58:32 +0000
committerNeil Brown <neilb@suse.de>2002-04-04 01:58:32 +0000
commite0d1903663dac9307a37646c26abf7991b0a9593 (patch)
tree882780adec3f7fa11826a34156426414db22d982 /Detail.c
parent11a3e71da434939895cc504e20e735eb656b1c74 (diff)
downloadmdadm-e0d1903663dac9307a37646c26abf7991b0a9593.tar.gz
mdadm-e0d1903663dac9307a37646c26abf7991b0a9593.tar.xz
mdadm-e0d1903663dac9307a37646c26abf7991b0a9593.zip
mdadm-0.8mdadm-0.8
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/Detail.c b/Detail.c
index 5082827..5320321 100644
--- a/Detail.c
+++ b/Detail.c
@@ -81,8 +81,8 @@ int Detail(char *dev, int brief)
if (brief)
printf("ARRAY %s level=%s disks=%d", dev, c?c:"-unknown-",array.raid_disks );
else {
- long array_size;
- long long larray_size;
+ unsigned long array_size;
+ unsigned long long larray_size;
#ifdef BLKGETSIZE64
if (ioctl(fd, BLKGETSIZE64, &larray_size)==0)
;
@@ -137,15 +137,20 @@ int Detail(char *dev, int brief)
printf("\n");
printf(" Number Major Minor RaidDisk State\n");
}
- for (d= 0; d<array.raid_disks+array.spare_disks; d++) {
+ for (d= 0; d<MD_SB_DISKS; d++) {
mdu_disk_info_t disk;
char *dv;
disk.number = d;
if (ioctl(fd, GET_DISK_INFO, &disk) < 0) {
- fprintf(stderr, Name ": cannot get disk detail for disk %d: %s\n",
- d, strerror(errno));
+ if (d < array.raid_disks)
+ fprintf(stderr, Name ": cannot get disk detail for disk %d: %s\n",
+ d, strerror(errno));
continue;
}
+ if (d >= array.raid_disks &&
+ disk.major == 0 &&
+ disk.minor == 0)
+ continue;
if (!brief) {
printf(" %5d %5d %5d %5d ",
disk.number, disk.major, disk.minor, disk.raid_disk);