]> 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, 17 Dec 2009 06:50:26 +0000 (22:50 -0800)
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>
(cherry picked from commit ad1e9c7084e99a67ee7a61c255a6059ebc9190c3)
Change-Id: I75c4cd03dadce5218407a5e663474b2cd22a34ad
Reviewed-on: http://gerrit.openafs.org/961

src/afsd/afsd.c

index cfd8730eb6fb535ed70094318e40717f26245668..0a489dd74c7a954e1aa7aaa647d49446d1dc228c 100644 (file)
@@ -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) {