linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mdadm: ioctl(GET_DISK_INFO) question
@ 2012-04-27 14:14 Alexander Lyakas
  2012-04-27 22:09 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Lyakas @ 2012-04-27 14:14 UTC (permalink / raw)
  To: linux-raid

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.

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?

Thanks,
  Alex.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-29 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-27 14:14 mdadm: ioctl(GET_DISK_INFO) question Alexander Lyakas
2012-04-27 22:09 ` NeilBrown
2012-04-29 20:21   ` Alexander Lyakas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).