--- postfix-2.7.1/src/util/fsspace.c 2006-06-15 20:07:16.000000000 +0200 +++ postfix-2.7.1.patched/src/util/fsspace.c 2010-06-28 16:31:06.515244528 +0200 @@ -57,6 +57,7 @@ #error "please specify the include file with `struct statvfs'" #endif #endif +#include /* Utility library. */ @@ -65,6 +66,8 @@ /* fsspace - find amount of available file system space */ +static void fs64space(const char *, struct fsspace * ); + void fsspace(const char *path, struct fsspace * sp) { const char *myname = "fsspace"; @@ -90,7 +93,15 @@ struct statvfs fsbuf; if (statvfs(path, &fsbuf) < 0) + { + if (errno == EOVERFLOW) + { + fs64space(path, sp); + return; + } + else msg_fatal("statvfs %s: %m", path); + } sp->block_size = fsbuf.f_frsize; sp->block_free = fsbuf.f_bavail; #endif @@ -99,6 +110,23 @@ myname, path, sp->block_size, sp->block_free); } +static void +fs64space(const char *path, struct fsspace * sp) +{ + const char *myname = "fs64space"; + struct statvfs64 fs64buf; + if (statvfs64(path, &fs64buf) < 0) + msg_fatal("statvfs64 %s: %m", path); + sp->block_size = 512; /* blocksize is variable on ZFS */ + if(fs64buf.f_bavail > (ULONG_MAX >> 1)) + sp->block_free = (ULONG_MAX >> 1); + else + sp->block_free = (unsigned long) fs64buf.f_bavail; + if (msg_verbose) + msg_info("%s: %s: block size %lu, blocks free %lu", + myname, path, sp->block_size, sp->block_free); +} + #ifdef TEST /*