summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-04-18 09:06:02 +1000
committerNeilBrown <neilb@suse.de>2012-04-18 09:06:02 +1000
commit480f3566411675ec41f18e5f6e15429f891e144c (patch)
tree8852fa9e20dbc83625bc53356b220231819e86ca /util.c
parentae2416e7b6937b9414321c5239e2ad415f7c1988 (diff)
downloadmdadm-480f3566411675ec41f18e5f6e15429f891e144c.tar.gz
Raid limit of 1024 when scanning for devices.
When we can for devices using GET_DISK_INFO we currently limit to 1024. But some arrays can have more than this. So raise it to 4096 and make the constant a #define. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index b942058..ac0f78c 100644
--- a/util.c
+++ b/util.c
@@ -378,7 +378,7 @@ int enough_fd(int fd)
array.raid_disks <= 0)
return 0;
avail = calloc(array.raid_disks, 1);
- for (i=0; i < 1024 && array.nr_disks > 0; i++) {
+ for (i=0; i < MAX_DISKS && array.nr_disks > 0; i++) {
disk.number = i;
if (ioctl(fd, GET_DISK_INFO, &disk) != 0)
continue;
@@ -1275,7 +1275,7 @@ void get_one_disk(int mdfd, mdu_array_info_t *ainf, mdu_disk_info_t *disk)
int d;
ioctl(mdfd, GET_ARRAY_INFO, ainf);
- for (d = 0 ; d < 1024 ; d++) {
+ for (d = 0 ; d < MAX_DISKS ; d++) {
if (ioctl(mdfd, GET_DISK_INFO, disk) == 0 &&
(disk->major || disk->minor))
return;