This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
An importanta patch for glibc 2.1.1
- To: libc-hacker@cygnus.com (GNU C Library)
- Subject: An importanta patch for glibc 2.1.1
- From: hjl@varesearch.com (H.J. Lu)
- Date: Wed, 7 Apr 1999 11:46:09 -0700 (PDT)
- Cc: gafton@redhat.com
We need this patch for glibc 2.1.1.
Thanks.
--
H.J. Lu (hjl@gnu.org)
---
Wed Apr 7 11:41:48 1999 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/fstatvfs.c (fstatvfs): Fix the
"f_frsize" field for EXT2.
Index: sysdeps/unix/sysv/linux/fstatvfs.c
===================================================================
RCS file: /local/work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/fstatvfs.c,v
retrieving revision 1.1.1.4
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/07 18:45:33
@@ -55,9 +55,28 @@ fstatvfs (int fd, struct statvfs *buf)
switch (fsbuf.f_type)
{
case EXT2_SUPER_MAGIC:
- /* This is not really correct since the fragment size can vary. */
- buf->f_frsize = 1024;
- break;
+ /* This is not really correct since the fragment size can vary.
+
+ buf->f_frsize = 1024;
+ break;
+
+ That is totally bogus. According to "The Single UNIX (R)
+ Specification, Version 2:
+
+ http://www.opengroup.org/onlinepubs/007908799/xsh/sysstatvfs.h.html
+
+ which the ext2 filesystem conforms to. It says:
+
+ unsigned long f_bsize file system block size
+ unsigned long f_frsize fundamental filesystem block
+ size
+ fsblkcnt_t f_blocks total number of blocks on file
+ system in units of f_frsize
+
+ We have to set f_frsize to the block size we use to calculate
+ f_blocks. Otherwise, programs like "df" will be get confused
+ on ext2 filesystems with block size != 1K. H.J.
+ */
case ADFS_SUPER_MAGIC:
case AFFS_SUPER_MAGIC: