--- mdadm-1.12.0/Create.c.s390 2005-06-13 20:04:13.000000000 -0400 +++ mdadm-1.12.0/Create.c 2007-01-31 13:48:23.000000000 -0500 @@ -28,6 +28,7 @@ */ #include "mdadm.h" +#include #include "md_u.h" #include "md_p.h" @@ -249,6 +250,15 @@ fprintf(stderr, Name ": no size and no drives given - aborting create.\n"); return 1; } + if (level == -1) { + /* linear devices need to be within the limit of + * INT_MAX or else they overflow math in the kernel + */ + if (maxsize > (unsigned long long)INT_MAX) { + fprintf(stderr, Name ": size of %s exceeds 0x%08x\n", maxdisc, INT_MAX); + return 1; + } + } if (level > 0) { /* size is meaningful */ if (minsize > 0x100000000ULL) {