A recently implemented statvfs()in glibc-2.1 is commonly defined instead of statfs(). However, this seems to be broken. Programs built with <sys/statvfs.h> instead of <sys/vfs.h> or <sys/statfs.h> will always report 0 bytes free for any partition. ------- Additional Comments From 05/06/99 16:09 ------- I can verify this too. Seems f_frsize is always 0 and some programs including inndf use f_frsize to calculate size of filesystem. #include <stdio.h> #include <sys/statvfs.h> int main(void) { struct statvfs buf; if (statvfs("/", &buf) != 0) exit(1); printf("f_bsize=%ld\nf_frsize=%ld\nf_blocks=%ld\nf_bfree=%ld\nf_bavail=%ld\nf_files=%ld\nf_ffree=%ld\nf_favail=%ld\nf_fsid=%ld\nf_flag=%ld\nf_namemax=%ld\n", buf.f_bsize, buf.f_frsize, buf.f_blocks, buf.f_bfree, buf.f_bavail, buf.f_files, buf.f_ffree, buf.f_favail, buf.f_fsid, buf.f_flag, buf.f_namemax); exit(0); }
The problem seems to be resulting from the glibc-2.11-fstatvfs.patch Is this patch really necessary at all? The offending parts of the patch (originally submitted from hjl to gafton): diff -u -p -r1.1.1.4 fstatvfs.c --- sysdeps/unix/sysv/linux/fstatvfs.c 1998/10/23 21:15:21 1.1.1.4 +++ sysdeps/unix/sysv/linux/fstatvfs.c 1999/04/09 22:08:15 @@ -80,8 +76,9 @@ fstatvfs (int fd, struct statvfs *buf) case UFS_MAGIC: case UFS_CIGAM: default: - /* I hope it's safe to assume no fragmentation. */ - buf->f_frsize = buf->f_bsize; + /* Since Linux doesn't support f_frsize, we set it to 0. "df" + will be happy with it. */ + buf->f_frsize = 0; break; } (should it really by enough that only "df" is happy about it?)
*** Bug 2519 has been marked as a duplicate of this bug. *** innwatch will always throttle the server, because it gets disk usage statistics from inndf, which will always report 0 bytes available because it was compiled with #define HAVE_STATVFS instead of #define HAVE_STATFS and #define HAVE_SYS_VFS_H Obviously, the new statvfs implementation does seem to be still somewhat lacking.
*** Bug 3214 has been marked as a duplicate of this bug. *** On a sparc64 ext2fs file system, statvfs is returning a struct statvfs with the element f_frsize == 0. Judging from the implementation in backends/inndf.c (inn-2.2), this value possibly should be the same as f_bsize (== 1024) rather than 0.
*** Bug 3304 has been marked as a duplicate of this bug. *** PHP's diskfreespace() function fails due to an error in RH6's glibc, see http://www.progressive-comp.com/Lists/?l=php3-general&m=92870575015735&w=2 I have also seen problems with Samba - related to Red Hat 6's glibc version (which is a pre-release of glibc). I think that an updated set of glibc RPMs (with the _released_ glibc 2.1 - not the pre-release) is an urgent need. Any time frame for that?
Is a updated RPM fixing this problem imminent? This bug is causing severe problems on my RH 6.0 servers, including a news server running INN.
Patch removed from the RPM, glibc upgraded to the stable 2.1.2. Package should be available in rawhide shortly.