1. Mount an NFS mount with non-default rsize and wsize: amd64:/tmp on /mnt/iso type nfs (rw,nfsvers=3,rsize=8192,wsize=8192,hard,nointr,addr=172.16.10.230) 2. Launch a simple test program which calls statvfs/statfs: #include <sys/statvfs.h> int main (int argc, char **argv) { struct statvfs statfs_buffer; statvfs ("/mnt/iso/", &statfs_buffer); return 0; } 3. Check the strace of that program statfs64("/mnt/iso/", 84, {f_type="NFS_SUPER_MAGIC", f_bsize=8192, f_blocks=1764078, f_bfree=1252601, f_bavail=1162989, f_files=1795200, f_ffree=1584215, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 The f_frsize member says "4096" instead of "8192". gnome-vfs and df (when using statvfs) and this code to calculate the amount of space left on a filesystem: free = statfs_buffer.f_frsize * statfs_buffer.f_bavail On a stock RHEL4 system, df is actually using statfs so doesn't show this problem: free = fsd.f_bsize * fsd.f_bavail
*** Bug 182596 has been marked as a duplicate of this bug. ***
Created attachment 132610 [details] reproducer program With the attached program, no occurance of bug found on 2.6.17-1.2356.fc6 and 2.6.15-1.2054_FC5. statvfs reports correct f_frsize with mount options rw,nfsvers=3,rsize=8192,wsize=8192,hard,nointr Would be good to know the kernel version or the rhel version on which the bug was observed.
The RHEL version is the one mentioned in the "Version" field. The test kernel was the latest stable RHEL4 kernel: 2.6.9-34.EL
Created attachment 132872 [details] fix 1 I was able to successfully reproduce the bug on 2.6.9-42.EL and it does go away with the attached fix. Upstream kernel and even devel branch of rhel kernel takes frsize as blocksize in superblock. I'm trying to find out exactly which patch changes this particular code. However, attached fix should serve the purpose.
My understanding is the NFS client file system should be able to use what ever it wants for f_frsize. As long as tbytes = f_frsize * f_blocks fbytes = f_frsize * f_bfree abytes = f_frsize * f_bavail That said, it is pointless, for NFS, if not all other file systems, to have f_frsize be different than f_bsize. It just causes confusion.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
committed in stream U5 build 42.13. A test kernel with this patch is available from http://people.redhat.com/~jbaron/rhel4/
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-0304.html