You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
688 lines
25 KiB
688 lines
25 KiB
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# Filename: package/.../musl/pkg/mdadm/0005-mdadm-musl-compile-fixes.patch |
|
# Copyright (C) 2013 The OpenSDE Project |
|
# |
|
# More information can be found in the files COPYING and README. |
|
# |
|
# This patch file is dual-licensed. It is available under the license the |
|
# patched project is licensed under, as long as it is an OpenSource license |
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
|
# of the GNU General Public License as published by the Free Software |
|
# Foundation; either version 2 of the License, or (at your option) any later |
|
# version. |
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
----------------------------------------------------------------------------- |
|
policy.c:217:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./policy.c.orig 2012-12-31 19:27:47.068270301 +0100 |
|
+++ ./policy.c 2012-12-31 19:52:16.454327330 +0100 |
|
@@ -214,7 +214,7 @@ |
|
continue; |
|
if ((stb.st_mode & S_IFMT) != S_IFBLK) |
|
continue; |
|
- if (stb.st_rdev != makedev(disk->disk.major, disk->disk.minor)) |
|
+ if (stb.st_rdev != (unsigned int)makedev(disk->disk.major, disk->disk.minor)) |
|
continue; |
|
closedir(by_path); |
|
return strdup(ent->d_name); |
|
|
|
----------------------------------------------------------------------------- |
|
util.c: In function 'md_get_version': |
|
util.c:138:5: error: overflow in implicit constant conversion [-Werror=overflow] |
|
util.c: In function 'enough_fd': |
|
util.c:378:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
util.c:384:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
util.c: In function 'super_by_fd': |
|
util.c:962:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
util.c: In function 'get_dev_size': |
|
util.c:1105:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
util.c: In function 'get_one_disk': |
|
util.c:1282:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
util.c:1284:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./util.c.orig 2012-12-31 19:58:26.898884477 +0100 |
|
+++ ./util.c 2012-12-31 20:00:36.381873014 +0100 |
|
@@ -135,7 +135,7 @@ |
|
if ((S_IFMT&stb.st_mode) != S_IFBLK) |
|
return -1; |
|
|
|
- if (ioctl(fd, RAID_VERSION, &vers) == 0) |
|
+ if (ioctl(fd, (int)RAID_VERSION, &vers) == 0) |
|
return (vers.major*10000) + (vers.minor*100) + vers.patchlevel; |
|
if (errno == EACCES) |
|
return -1; |
|
@@ -375,13 +375,13 @@ |
|
int i, rv; |
|
char *avail; |
|
|
|
- if (ioctl(fd, GET_ARRAY_INFO, &array) != 0 || |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array) != 0 || |
|
array.raid_disks <= 0) |
|
return 0; |
|
avail = calloc(array.raid_disks, 1); |
|
for (i=0; i < MAX_DISKS && array.nr_disks > 0; i++) { |
|
disk.number = i; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) != 0) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) != 0) |
|
continue; |
|
if (disk.major == 0 && disk.minor == 0) |
|
continue; |
|
@@ -959,7 +959,7 @@ |
|
minor = sra->array.minor_version; |
|
verstr = sra->text_version; |
|
} else { |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array)) |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array)) |
|
array.major_version = array.minor_version = 0; |
|
vers = array.major_version; |
|
minor = array.minor_version; |
|
@@ -1102,7 +1102,7 @@ |
|
ldsize = (unsigned long long)st.st_size; |
|
else |
|
#ifdef BLKGETSIZE64 |
|
- if (ioctl(fd, BLKGETSIZE64, &ldsize) != 0) |
|
+ if (ioctl(fd, (int)BLKGETSIZE64, &ldsize) != 0) |
|
#endif |
|
{ |
|
unsigned long dsize; |
|
@@ -1279,9 +1279,9 @@ |
|
{ |
|
int d; |
|
|
|
- ioctl(mdfd, GET_ARRAY_INFO, ainf); |
|
+ ioctl(mdfd, (int)GET_ARRAY_INFO, ainf); |
|
for (d = 0 ; d < MAX_DISKS ; d++) { |
|
- if (ioctl(mdfd, GET_DISK_INFO, disk) == 0 && |
|
+ if (ioctl(mdfd, (int)GET_DISK_INFO, disk) == 0 && |
|
(disk->major || disk->minor)) |
|
return; |
|
} |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Manage.c: In function 'Manage_ro': |
|
Manage.c:98:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c: In function 'Manage_resize': |
|
Manage.c:369:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c: In function 'Manage_subdevs': |
|
Manage.c:422:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:468:5: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:502:5: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:716:6: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:788:7: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:884:7: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:931:5: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Manage.c:966:6: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Manage.c.orig 2012-12-31 20:05:54.117244641 +0100 |
|
+++ ./Manage.c 2012-12-31 20:14:30.889202023 +0100 |
|
@@ -95,7 +95,7 @@ |
|
goto out; |
|
} |
|
#endif |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array)) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array)) { |
|
fprintf(stderr, Name ": %s does not appear to be active.\n", |
|
devname); |
|
rv = 1; |
|
@@ -366,7 +366,7 @@ |
|
int Manage_resize(char *devname, int fd, long long size, int raid_disks) |
|
{ |
|
mdu_array_info_t info; |
|
- if (ioctl(fd, GET_ARRAY_INFO, &info) != 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &info) != 0) { |
|
fprintf(stderr, Name ": Cannot get array information for %s: %s\n", |
|
devname, strerror(errno)); |
|
return 1; |
|
@@ -419,7 +419,7 @@ |
|
struct mdinfo info; |
|
int frozen = 0; |
|
|
|
- if (ioctl(fd, GET_ARRAY_INFO, &array)) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array)) { |
|
fprintf(stderr, Name ": cannot get array info for %s\n", |
|
devname); |
|
goto abort; |
|
@@ -465,7 +465,7 @@ |
|
for (; j < MAX_DISKS && remaining_disks > 0; j++) { |
|
unsigned dev; |
|
disc.number = j; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc)) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc)) |
|
continue; |
|
if (disc.major == 0 && disc.minor == 0) |
|
continue; |
|
@@ -499,7 +499,7 @@ |
|
int sfd; |
|
unsigned dev; |
|
disc.number = j; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc)) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc)) |
|
continue; |
|
if (disc.major == 0 && disc.minor == 0) |
|
continue; |
|
@@ -713,7 +713,7 @@ |
|
char *dev; |
|
int dfd; |
|
disc.number = j; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc)) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc)) |
|
continue; |
|
if (disc.major==0 && disc.minor==0) |
|
continue; |
|
@@ -785,7 +785,7 @@ |
|
get_linux_version() <= 2006018) |
|
goto skip_re_add; |
|
disc.number = mdi.disk.number; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc) != 0 |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc) != 0 |
|
|| disc.major != 0 || disc.minor != 0 |
|
) |
|
goto skip_re_add; |
|
@@ -881,7 +881,7 @@ |
|
|
|
for (d = 0; d < MAX_DISKS && found < array.active_disks; d++) { |
|
disc.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc)) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc)) |
|
continue; |
|
if (disc.major == 0 && disc.minor == 0) |
|
continue; |
|
@@ -928,7 +928,7 @@ |
|
*/ |
|
for (j = array.raid_disks; j< tst->max_devs; j++) { |
|
disc.number = j; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc)) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc)) |
|
break; |
|
if (disc.major==0 && disc.minor==0) |
|
break; |
|
@@ -963,7 +963,7 @@ |
|
for (j=0; j< tst->max_devs; j++) { |
|
mdu_disk_info_t disc2; |
|
disc2.number = j; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc2)) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc2)) |
|
continue; |
|
if (disc2.major==0 && disc2.minor==0) |
|
continue; |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Create.c:164:7: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Create.c:595:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Create.c.orig 2012-12-31 20:16:07.671435365 +0100 |
|
+++ ./Create.c 2012-12-31 20:17:02.504732226 +0100 |
|
@@ -161,7 +161,7 @@ |
|
memset(&inf, 0, sizeof(inf)); |
|
fd = open(devlist->devname, O_RDONLY); |
|
if (fd >= 0 && |
|
- ioctl(fd, GET_ARRAY_INFO, &inf) == 0 && |
|
+ ioctl(fd, (int)GET_ARRAY_INFO, &inf) == 0 && |
|
inf.raid_disks == 0) { |
|
/* yep, looks like a container */ |
|
if (st) { |
|
@@ -592,7 +592,7 @@ |
|
} else { |
|
mdu_array_info_t inf; |
|
memset(&inf, 0, sizeof(inf)); |
|
- ioctl(mdfd, GET_ARRAY_INFO, &inf); |
|
+ ioctl(mdfd, (int)GET_ARRAY_INFO, &inf); |
|
if (inf.working_disks != 0) { |
|
fprintf(stderr, Name ": another array by this name" |
|
" is already running.\n"); |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Detail.c:81:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Detail.c:118:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Detail.c:246:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Detail.c:296:7: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Detail.c:361:7: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Detail.c.orig 2012-12-31 20:18:51.899223201 +0100 |
|
+++ ./Detail.c 2012-12-31 20:20:11.589100167 +0100 |
|
@@ -78,7 +78,7 @@ |
|
close(fd); |
|
return rv; |
|
} |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array)<0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array)<0) { |
|
if (errno == ENODEV) |
|
fprintf(stderr, Name ": md device %s does not appear to be active.\n", |
|
dev); |
|
@@ -115,7 +115,7 @@ |
|
int fd2; |
|
int err; |
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) |
|
continue; |
|
if (d >= array.raid_disks && |
|
disk.major == 0 && |
|
@@ -243,7 +243,7 @@ |
|
for (d=0; d < max_disks; d++) { |
|
mdu_disk_info_t disk; |
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) { |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) { |
|
if (d < array.raid_disks) |
|
fprintf(stderr, Name ": cannot get device detail for device %d: %s\n", |
|
d, strerror(errno)); |
|
@@ -293,7 +293,7 @@ |
|
|
|
/* Only try GET_BITMAP_FILE for 0.90.01 and later */ |
|
if (vers >= 9001 && |
|
- ioctl(fd, GET_BITMAP_FILE, &bmf) == 0 && |
|
+ ioctl(fd, (int)GET_BITMAP_FILE, &bmf) == 0 && |
|
bmf.pathname[0]) { |
|
printf(" bitmap=%s", bmf.pathname); |
|
} |
|
@@ -358,7 +358,7 @@ |
|
printf("\n"); |
|
/* Only try GET_BITMAP_FILE for 0.90.01 and later */ |
|
if (vers >= 9001 && |
|
- ioctl(fd, GET_BITMAP_FILE, &bmf) == 0 && |
|
+ ioctl(fd, (int)GET_BITMAP_FILE, &bmf) == 0 && |
|
bmf.pathname[0]) { |
|
printf(" Intent Bitmap : %s\n", bmf.pathname); |
|
printf("\n"); |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Grow.c: In function 'Grow_Add_device': |
|
Grow.c:117:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:161:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:221:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:232:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c: In function 'Grow_addbitmap': |
|
Grow.c:299:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:319:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:394:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:453:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c: In function 'Grow_reshape': |
|
Grow.c:1478:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:1716:6: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:1756:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:1785:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:1963:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c: In function 'reshape_array': |
|
Grow.c:2113:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:2292:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:2503:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c: In function 'Grow_continue_command': |
|
Grow.c:3998:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Grow.c:4014:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Grow.c.orig 2012-12-31 20:22:21.952118074 +0100 |
|
+++ ./Grow.c 2012-12-31 20:27:36.859416122 +0100 |
|
@@ -114,7 +114,7 @@ |
|
struct supertype *st = NULL; |
|
char *subarray = NULL; |
|
|
|
- if (ioctl(fd, GET_ARRAY_INFO, &info.array) < 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &info.array) < 0) { |
|
fprintf(stderr, Name ": cannot get array info for %s\n", devname); |
|
return 1; |
|
} |
|
@@ -158,7 +158,7 @@ |
|
st->ss->free_super(st); |
|
|
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) { |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) { |
|
fprintf(stderr, Name ": cannot get device detail for device %d\n", |
|
d); |
|
close(nfd); |
|
@@ -218,7 +218,7 @@ |
|
* Now go through and update all superblocks |
|
*/ |
|
|
|
- if (ioctl(fd, GET_ARRAY_INFO, &info.array) < 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &info.array) < 0) { |
|
fprintf(stderr, Name ": cannot get array info for %s\n", devname); |
|
return 1; |
|
} |
|
@@ -229,7 +229,7 @@ |
|
char *dv; |
|
|
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) { |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) { |
|
fprintf(stderr, Name ": cannot get device detail for device %d\n", |
|
d); |
|
return 1; |
|
@@ -296,7 +296,7 @@ |
|
" the Linux kernel.\n"); |
|
} |
|
|
|
- if (ioctl(fd, GET_BITMAP_FILE, &bmf) != 0) { |
|
+ if (ioctl(fd, (int)GET_BITMAP_FILE, &bmf) != 0) { |
|
if (errno == ENOMEM) |
|
fprintf(stderr, Name ": Memory allocation failure.\n"); |
|
else |
|
@@ -316,7 +316,7 @@ |
|
devname, bmf.pathname); |
|
return 1; |
|
} |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array) != 0) { |
|
fprintf(stderr, Name ": cannot get array status for %s\n", devname); |
|
return 1; |
|
} |
|
@@ -391,7 +391,7 @@ |
|
mdu_disk_info_t disk; |
|
char *dv; |
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) |
|
continue; |
|
if (disk.major == 0 && |
|
disk.minor == 0) |
|
@@ -450,7 +450,7 @@ |
|
char *dv; |
|
int fd2; |
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) |
|
continue; |
|
if ((disk.major==0 && disk.minor==0) || |
|
(disk.state & (1<<MD_DISK_REMOVED))) |
|
@@ -1475,7 +1475,7 @@ |
|
struct mdinfo info; |
|
struct mdinfo *sra; |
|
|
|
- if (ioctl(fd, GET_ARRAY_INFO, &array) < 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array) < 0) { |
|
fprintf(stderr, Name ": %s is not an active md array - aborting\n", |
|
devname); |
|
return 1; |
|
@@ -1713,7 +1713,7 @@ |
|
/* get array parametes after takeover |
|
* to chane one parameter at time only |
|
*/ |
|
- rv = ioctl(fd, GET_ARRAY_INFO, &array); |
|
+ rv = ioctl(fd, (int)GET_ARRAY_INFO, &array); |
|
} |
|
} |
|
/* make sure mdmon is |
|
@@ -1753,7 +1753,7 @@ |
|
/* go back to raid0, drop parity disk |
|
*/ |
|
sysfs_set_str(sra, NULL, "level", "raid0"); |
|
- ioctl(fd, GET_ARRAY_INFO, &array); |
|
+ ioctl(fd, (int)GET_ARRAY_INFO, &array); |
|
} |
|
|
|
size_change_error: |
|
@@ -1782,7 +1782,7 @@ |
|
sysfs_set_str(sra, NULL, "resync_start", "none") < 0) |
|
fprintf(stderr, Name ": --assume-clean not supported with --grow on this kernel\n"); |
|
} |
|
- ioctl(fd, GET_ARRAY_INFO, &array); |
|
+ ioctl(fd, (int)GET_ARRAY_INFO, &array); |
|
size = get_component_size(fd)/2; |
|
if (size == 0) |
|
size = array.size; |
|
@@ -1960,7 +1960,7 @@ |
|
rv =1 ; |
|
} |
|
if (layout_str) { |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array) != 0) { |
|
dprintf("Cannot get array information.\n"); |
|
goto release; |
|
} |
|
@@ -2110,7 +2110,7 @@ |
|
/* when reshaping a RAID0, the component_size might be zero. |
|
* So try to fix that up. |
|
*/ |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array) != 0) { |
|
dprintf("Cannot get array information.\n"); |
|
goto release; |
|
} |
|
@@ -2289,7 +2289,7 @@ |
|
* some more changes: layout, raid_disks, chunk_size |
|
*/ |
|
/* read current array info */ |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array) != 0) { |
|
dprintf("Cannot get array information.\n"); |
|
goto release; |
|
} |
|
@@ -2500,7 +2500,7 @@ |
|
reshape.before.layout == reshape.after.layout && |
|
st->ss->external == 0) { |
|
/* use SET_ARRAY_INFO but only if reshape hasn't started */ |
|
- ioctl(fd, GET_ARRAY_INFO, &array); |
|
+ ioctl(fd, (int)GET_ARRAY_INFO, &array); |
|
array.raid_disks = reshape.after.data_disks + reshape.parity; |
|
if (!restart && |
|
ioctl(fd, SET_ARRAY_INFO, &array) != 0) { |
|
@@ -3995,7 +3995,7 @@ |
|
if (st->ss->external == 0) { |
|
int d; |
|
dprintf("native array (%s)\n", devname); |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array.array) < 0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array.array) < 0) { |
|
fprintf(stderr, Name ": %s is not an active md array -" |
|
" aborting\n", devname); |
|
ret_val = 1; |
|
@@ -4011,7 +4011,7 @@ |
|
char *dv; |
|
int err; |
|
disk.number = d; |
|
- if (ioctl(fd, GET_DISK_INFO, &disk) < 0) |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disk) < 0) |
|
continue; |
|
if (disk.major == 0 && disk.minor == 0) |
|
continue; |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Monitor.c: In function 'check_array': |
|
Monitor.c:477:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Monitor.c:596:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Monitor.c:648:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] |
|
Monitor.c: In function 'add_new_arrays': |
|
Monitor.c:687:8: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Monitor.c.orig 2012-12-31 20:29:37.462193570 +0100 |
|
+++ ./Monitor.c 2012-12-31 20:31:49.977256244 +0100 |
|
@@ -474,7 +474,7 @@ |
|
return 0; |
|
} |
|
fcntl(fd, F_SETFD, FD_CLOEXEC); |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array)<0) { |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array)<0) { |
|
if (!st->err) |
|
alert("DeviceDisappeared", dev, NULL, ainfo); |
|
st->err=1; |
|
@@ -593,7 +593,7 @@ |
|
i++) { |
|
mdu_disk_info_t disc; |
|
disc.number = i; |
|
- if (ioctl(fd, GET_DISK_INFO, &disc) >= 0) { |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc) >= 0) { |
|
info[i].state = disc.state; |
|
info[i].major = disc.major; |
|
info[i].minor = disc.minor; |
|
@@ -645,7 +645,7 @@ |
|
alert("Fail", dev, dv, ainfo); |
|
else if ((newstate & (1<<MD_DISK_FAULTY)) && |
|
(disc.major || disc.minor) && |
|
- st->devid[i] == makedev(disc.major, disc.minor)) |
|
+ st->devid[i] == (unsigned int)makedev(disc.major, disc.minor)) |
|
alert("FailSpare", dev, dv, ainfo); |
|
else if ((newstate&change)&(1<<MD_DISK_SYNC)) |
|
alert("SpareActive", dev, dv, ainfo); |
|
@@ -684,7 +684,7 @@ |
|
continue; |
|
st->devname = strdup(get_md_name(mse->devnum)); |
|
if ((fd = open(st->devname, O_RDONLY)) < 0 || |
|
- ioctl(fd, GET_ARRAY_INFO, &array)< 0) { |
|
+ ioctl(fd, (int)GET_ARRAY_INFO, &array)< 0) { |
|
/* no such array */ |
|
if (fd >=0) close(fd); |
|
put_md_name(st->devname); |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Query.c: In function 'Query': |
|
Query.c:56:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Query.c:103:9: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Query.c:104:6: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Query.c.orig 2012-12-31 20:32:56.982789319 +0100 |
|
+++ ./Query.c 2012-12-31 20:33:43.743900230 +0100 |
|
@@ -53,7 +53,7 @@ |
|
} |
|
|
|
vers = md_get_version(fd); |
|
- if (ioctl(fd, GET_ARRAY_INFO, &array)<0) |
|
+ if (ioctl(fd, (int)GET_ARRAY_INFO, &array)<0) |
|
ioctlerr = errno; |
|
else ioctlerr = 0; |
|
|
|
@@ -100,8 +100,8 @@ |
|
activity = "undetected"; |
|
if (mddev && (fd = open(mddev, O_RDONLY))>=0) { |
|
if (md_get_version(fd) >= 9000 && |
|
- ioctl(fd, GET_ARRAY_INFO, &array)>= 0) { |
|
- if (ioctl(fd, GET_DISK_INFO, &disc) >= 0 && |
|
+ ioctl(fd, (int)GET_ARRAY_INFO, &array)>= 0) { |
|
+ if (ioctl(fd, (int)GET_DISK_INFO, &disc) >= 0 && |
|
makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev) |
|
activity = "active"; |
|
else |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
Incremental.c: In function 'Incremental': |
|
Incremental.c:371:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Incremental.c:503:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Incremental.c: In function 'find_reject': |
|
Incremental.c:605:2: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Incremental.c: In function 'container_members_max_degradation': |
|
Incremental.c:770:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Incremental.c: In function 'IncrementalScan': |
|
Incremental.c:1282:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
Incremental.c:1298:4: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./Incremental.c.orig 2012-12-31 20:34:38.097145590 +0100 |
|
+++ ./Incremental.c 2012-12-31 20:34:51.073428917 +0100 |
|
@@ -368,7 +368,7 @@ |
|
&& ! policy_action_allows(policy, st->ss->name, |
|
act_re_add) |
|
&& runstop < 1) { |
|
- if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0) { |
|
+ if (ioctl(mdfd, (int)GET_ARRAY_INFO, &ainf) == 0) { |
|
fprintf(stderr, Name |
|
": not adding %s to active array (without --run) %s\n", |
|
devname, chosen_name); |
|
@@ -500,7 +500,7 @@ |
|
/* + add any bitmap file */ |
|
/* + start the array (auto-readonly). */ |
|
|
|
- if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0) { |
|
+ if (ioctl(mdfd, (int)GET_ARRAY_INFO, &ainf) == 0) { |
|
if (verbose >= 0) |
|
fprintf(stderr, Name |
|
": %s attached to %s which is already active.\n", |
|
@@ -602,7 +602,7 @@ |
|
struct mdinfo *d; |
|
mdu_array_info_t ra; |
|
|
|
- if (ioctl(mdfd, GET_ARRAY_INFO, &ra) == 0) |
|
+ if (ioctl(mdfd, (int)GET_ARRAY_INFO, &ra) == 0) |
|
return; /* not safe to remove from active arrays |
|
* without thinking more */ |
|
|
|
@@ -767,7 +767,7 @@ |
|
if (afd < 0) |
|
continue; |
|
/* most accurate information regarding array degradation */ |
|
- if (ioctl(afd, GET_ARRAY_INFO, &array) >= 0) { |
|
+ if (ioctl(afd, (int)GET_ARRAY_INFO, &array) >= 0) { |
|
int degraded = array.raid_disks - array.active_disks - |
|
array.spare_disks; |
|
if (degraded > max_degraded) |
|
@@ -1279,7 +1279,7 @@ |
|
|
|
if (mdfd < 0) |
|
continue; |
|
- if (ioctl(mdfd, GET_ARRAY_INFO, &array) == 0 || |
|
+ if (ioctl(mdfd, (int)GET_ARRAY_INFO, &array) == 0 || |
|
errno != ENODEV) { |
|
close(mdfd); |
|
continue; |
|
@@ -1295,7 +1295,7 @@ |
|
* is a hint only |
|
*/ |
|
int added = -1; |
|
- if (ioctl(mdfd, GET_ARRAY_INFO, &bmf) < 0) { |
|
+ if (ioctl(mdfd, (int)GET_ARRAY_INFO, &bmf) < 0) { |
|
int bmfd = open(mddev->bitmap_file, O_RDWR); |
|
if (bmfd >= 0) { |
|
added = ioctl(mdfd, SET_BITMAP_FILE, |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
mdopen.c: In function 'make_parts': |
|
mdopen.c:77:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] |
|
mdopen.c: In function 'create_mddev': |
|
mdopen.c:342:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./mdopen.c.orig 2012-12-31 20:37:08.680627411 +0100 |
|
+++ ./mdopen.c 2012-12-31 20:37:50.805605089 +0100 |
|
@@ -74,7 +74,7 @@ |
|
if (stat(name, &stb2)==0) { |
|
if (!S_ISBLK(stb2.st_mode) || !S_ISBLK(stb.st_mode)) |
|
continue; |
|
- if (stb2.st_rdev == makedev(major_num, minor_num+i)) |
|
+ if (stb2.st_rdev == (unsigned int)makedev(major_num, minor_num+i)) |
|
continue; |
|
unlink(name); |
|
} else { |
|
@@ -339,7 +339,7 @@ |
|
if (lstat(devname, &stb) == 0) { |
|
/* Must be the correct device, else error */ |
|
if ((stb.st_mode&S_IFMT) != S_IFBLK || |
|
- stb.st_rdev != makedev(dev2major(num),dev2minor(num))) { |
|
+ stb.st_rdev != (unsigned int)makedev(dev2major(num),dev2minor(num))) { |
|
fprintf(stderr, Name ": %s exists but looks wrong, please fix\n", |
|
devname); |
|
return -1; |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
sysfs.c: In function 'sysfs_init': |
|
sysfs.c:87:3: error: overflow in implicit constant conversion [-Werror=overflow] |
|
----------------------------------------------------------------------------- |
|
|
|
--- ./sysfs.c.orig 2012-12-31 20:39:07.367406882 +0100 |
|
+++ ./sysfs.c 2012-12-31 20:39:19.959686963 +0100 |
|
@@ -84,7 +84,7 @@ |
|
mdi->sys_name[0] = 0; |
|
if (fd >= 0) { |
|
mdu_version_t vers; |
|
- if (ioctl(fd, RAID_VERSION, &vers) != 0) |
|
+ if (ioctl(fd, (int)RAID_VERSION, &vers) != 0) |
|
return; |
|
devnum = fd2devnum(fd); |
|
}
|
|
|