Paul Eggert <egg...@cs.ucla.edu> wrote: > On 01/29/2013 06:44 PM, Eric Wong wrote: > > eglibc on Debian is only configured to only use features available in > > Linux 2.6.26 at build time. This means statvfs() uses stat() internally > > regardless of the run-time kernel version[1]. > > That sounds like a bug in eglibc. Perhaps you can fix this problem on the > eglibc side. That is, eglibc can use only 2.6.26 features, but make an > exception for this feature, since it's obviously needed.
Actually, reading the eglibc and kernel source more closely, my initial analysis seems wrong, and I'm even more at a loss as to why stat() gets called when I call statvfs(). The stat() I see after statfs() is /not/ happening from a check of where the 2.6.36+ kernel sets ST_VALID: At first, I thought the following code was entering __statvfs_getflags() in sysdeps/unix/sysv/linux/internal_statvfs.c: #ifndef __ASSUME_STATFS_F_FLAGS if ((fsbuf->f_flags & ST_VALID) == 0) /* Determining the flags is tricky. We have to read /proc/mounts or the /etc/mtab file and search for the entry which matches the given file. The way we can test for matching filesystem is using the device number. */ buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st); else #endif buf->f_flag = fsbuf->f_flags ^ ST_VALID; ----------------------------------------------------------------- But now I see it's not, since __statvfs_getflags() would also open /proc/mounts (which I don't see happening). Anyways I've filed a bug report with Debian: http://bugs.debian.org/699321 Thanks for looking at this, hopefully somebody from Debian can help.