1 |
slords |
1.1 |
--- mdadm-1.12.0/Create.c.s390 2005-06-13 20:04:13.000000000 -0400 |
2 |
|
|
+++ mdadm-1.12.0/Create.c 2007-01-31 13:48:23.000000000 -0500 |
3 |
|
|
@@ -28,6 +28,7 @@ |
4 |
|
|
*/ |
5 |
|
|
|
6 |
|
|
#include "mdadm.h" |
7 |
|
|
+#include <limits.h> |
8 |
|
|
#include "md_u.h" |
9 |
|
|
#include "md_p.h" |
10 |
|
|
|
11 |
|
|
@@ -249,6 +250,15 @@ |
12 |
|
|
fprintf(stderr, Name ": no size and no drives given - aborting create.\n"); |
13 |
|
|
return 1; |
14 |
|
|
} |
15 |
|
|
+ if (level == -1) { |
16 |
|
|
+ /* linear devices need to be within the limit of |
17 |
|
|
+ * INT_MAX or else they overflow math in the kernel |
18 |
|
|
+ */ |
19 |
|
|
+ if (maxsize > (unsigned long long)INT_MAX) { |
20 |
|
|
+ fprintf(stderr, Name ": size of %s exceeds 0x%08x\n", maxdisc, INT_MAX); |
21 |
|
|
+ return 1; |
22 |
|
|
+ } |
23 |
|
|
+ } |
24 |
|
|
if (level > 0) { |
25 |
|
|
/* size is meaningful */ |
26 |
|
|
if (minsize > 0x100000000ULL) { |