]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
make afsd partition size check be large partition safe
authorDerrick Brashear <shadow@dementia.org>
Tue, 1 Sep 2009 17:00:00 +0000 (13:00 -0400)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 3 Sep 2009 19:37:09 +0000 (12:37 -0700)
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 <matt@linuxbox.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afsd/afsd.c

index 20d63098b6d9688609c1f1ebe59e12f80a9c8ff2..c082bd62b801da9b36c122abad4f89c19677413e 100644 (file)
@@ -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) {