]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
super0: fix overflow when checking max size.
authorNeilBrown <neilb@suse.de>
Thu, 20 Oct 2011 02:14:26 +0000 (13:14 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 20 Oct 2011 02:14:26 +0000 (13:14 +1100)
We need to force multiplication to use ULL before they
get to big, else it overflows.  So move the "2ULL" to the start.

Signed-off-by: NeilBrown <neilb@suse.de>
super0.c

index 3061ecfe76f41b7e21e3f36a75866f6502114ad8..f3d0c07cc74750363c9a1b353d1a0f3a39b83053 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -1142,7 +1142,7 @@ static int validate_geometry0(struct supertype *st, int level,
                                MD_SB_DISKS);
                return 0;
        }
-       if (size >= tbmax * 1024*1024*1024*2ULL) {
+       if (size >= tbmax * 2ULL*1024*1024*1024) {
                if (verbose)
                        fprintf(stderr, Name ": 0.90 metadata supports at most "
                                "%d terabytes per device\n", tbmax);