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-stable-1_4_12pre1~39 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ff484b9c3ad6deea30dded2aba5e728785af10b8;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 (cherry picked from commit ad1e9c7084e99a67ee7a61c255a6059ebc9190c3) Change-Id: I75c4cd03dadce5218407a5e663474b2cd22a34ad Reviewed-on: http://gerrit.openafs.org/961 --- diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index cfd8730eb..0a489dd74 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -611,7 +611,8 @@ int 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; @@ -646,7 +647,7 @@ int 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) {