27 lines
759 B
Diff
27 lines
759 B
Diff
|
--- mdadm-3.2.2/util.c.readd 2011-06-17 01:15:50.000000000 -0400
|
||
|
+++ mdadm-3.2.2/util.c 2011-07-18 14:43:40.776150946 -0400
|
||
|
@@ -364,19 +364,21 @@ int enough_fd(int fd)
|
||
|
struct mdu_disk_info_s disk;
|
||
|
int avail_disks = 0;
|
||
|
int i;
|
||
|
+ int raid_disks;
|
||
|
char *avail;
|
||
|
|
||
|
if (ioctl(fd, GET_ARRAY_INFO, &array) != 0 ||
|
||
|
array.raid_disks <= 0)
|
||
|
return 0;
|
||
|
avail = calloc(array.raid_disks, 1);
|
||
|
- for (i=0; i < 1024 && array.nr_disks > 0; i++) {
|
||
|
+ raid_disks = array.raid_disks;
|
||
|
+ for (i=0; i < 1024 && raid_disks > 0; i++) {
|
||
|
disk.number = i;
|
||
|
if (ioctl(fd, GET_DISK_INFO, &disk) != 0)
|
||
|
continue;
|
||
|
if (disk.major == 0 && disk.minor == 0)
|
||
|
continue;
|
||
|
- array.nr_disks--;
|
||
|
+ raid_disks--;
|
||
|
|
||
|
if (! (disk.state & (1<<MD_DISK_SYNC)))
|
||
|
continue;
|