[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#220992: libc6: statfs.f_frsize incorrectly set with linux kernel 2.2

Package: libc6
Version: 2.3.2-9
Severity: important

df reports totally wrong values for disk usage with glibc-2.3.2-9
and linux 2.2

I believe I've tracked it down to a recent in the code for statfs.
Lines 22-24 of sysdeps/unix/sysv/linux/internal_statvfs.c read:

  /* Linux has the f_frsize size only in later version of the kernel.
     If the value is not filled in use f_bsize.  */
  buf->f_frsize = fsbuf.f_frsize ?: fsbuf.f_bsize;

When fsbuf.f_bsize is not set, f_frsize gets some garbage value.

At least that would explain the insane df output I get:
$ df -k /
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda5            -2517475024004         1         0   1% /

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux uruguay 2.2.20-idepci #1 Sat Apr 20 12:45:19 EST 2002 i686

Versions of packages libc6 depends on:
ii  libdb1-compat                 2.1.3-7    The Berkeley database routines [gl

Reply to: