From: NeilBrown <neilb@suse.de>
To: Alexander Lyakas <alex.bolshoy@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: mdadm: ioctl(GET_DISK_INFO) question
Date: Sat, 28 Apr 2012 08:09:11 +1000 [thread overview]
Message-ID: <20120428080911.10fe2f47@notabene.brown> (raw)
In-Reply-To: <CAGRgLy4p0aiZD92dJsV3tdcZyPaJ=8Nc6CKWVcQU20QtMb6MBQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 767 bytes --]
On Fri, 27 Apr 2012 17:14:28 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-04-27 22:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 14:14 mdadm: ioctl(GET_DISK_INFO) question Alexander Lyakas
2012-04-27 22:09 ` NeilBrown [this message]
2012-04-29 20:21 ` Alexander Lyakas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120428080911.10fe2f47@notabene.brown \
--to=neilb@suse.de \
--cc=alex.bolshoy@gmail.com \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).