diff options
author | Neil Brown <neilb@suse.de> | 2002-04-04 01:58:32 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2002-04-04 01:58:32 +0000 |
commit | e0d1903663dac9307a37646c26abf7991b0a9593 (patch) | |
tree | 882780adec3f7fa11826a34156426414db22d982 /Detail.c | |
parent | 11a3e71da434939895cc504e20e735eb656b1c74 (diff) | |
download | mdadm-e0d1903663dac9307a37646c26abf7991b0a9593.tar.gz mdadm-e0d1903663dac9307a37646c26abf7991b0a9593.tar.xz mdadm-e0d1903663dac9307a37646c26abf7991b0a9593.zip |
mdadm-0.8mdadm-0.8
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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); |