Re: mdadm: ioctl(GET_DISK_INFO) question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 27 Apr 2012 17:14:28 +0300 Alexander Lyakas <alex.bolshoy@xxxxxxxxx>
wrote:

> Hello,
> 
> what is the reason that in some places (like Detail()), the code tests
> for all desc_nrs possible (value read from superblock or MaxDisks
> macro):
> for (d = 0; d < max_disks; d++) {
>     disc.number = d;
>     ioctl(fd, GET_DISK_INFO, &disk)
> 
> and in other places (like Monitor()), the loop goes only up to :
> array.raid_disks + array.nr_disks.

Bug.

> 
> After all, disk.number (which is rdev->desc_nr in kernel) is merely a
> position of the disk entry in the dev_roles[] array in the superblock,
> and has no relation to the raid slot of the disk. Shouldn't the code
> always check max_disks possible?

Yes.

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux