From: Derrick Brashear Date: Tue, 1 Sep 2009 17:00:00 +0000 (-0400) Subject: make afsd partition size check be large partition safe X-Git-Tag: openafs-devel-1_5_63~45 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ad1e9c7084e99a67ee7a61c255a6059ebc9190c3;p=packages%2Fo%2Fopenafs.git make afsd partition size check be large partition safe right now the math overflows the 32 bit type for >2tb partitions. use larger variables to avoid this. Reviewed-on: http://gerrit.openafs.org/392 Reviewed-by: Matt Benjamin Reviewed-by: Andrew Deason Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 20d63098b..c082bd62b 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -619,7 +619,8 @@ ParseCacheInfoFile(void) int PartSizeOverflow(char *path, int cs) { - int bsize = -1, totalblks, mint; + int bsize = -1; + afs_int64 totalblks, mint; #if AFS_HAVE_STATVFS struct statvfs statbuf; @@ -654,7 +655,7 @@ PartSizeOverflow(char *path, int cs) bsize = statbuf.f_bsize; #endif if (bsize == -1) - return 0; /* sucess */ + return 0; /* success */ /* now free and totalblks are in fragment units, but we want them in 1K units */ if (bsize >= 1024) {