aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2005-01-04 21:48:45 +0100
committerTrond Myklebust <trond.myklebust@fys.uio.no>2005-01-04 21:48:45 +0100
commitc4c7eb1af381a3101e185f25540176030a4a5a5d (patch)
tree9edd9ec40f74ee46df0617532f998f59846f0cc6 /fs
parent74ce6fec28a0c7862d7832dfdd8e0a73a9d24223 (diff)
downloadhistory-c4c7eb1af381a3101e185f25540176030a4a5a5d.tar.gz
Subject: [PATCH] NFS: incorrect "df" results
Description: Fix an NFS client bug introduced in 2.6.9-rc1. The "df" command was reporting the size of NFS file systems incorrectly. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/inode.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 400c457e340080..8701801966dcd0 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -486,13 +486,27 @@ nfs_statfs(struct super_block *sb, struct kstatfs *buf)
if (error < 0)
goto out_err;
- buf->f_frsize = server->wtmult;
+ /*
+ * Current versions of glibc do not correctly handle the
+ * case where f_frsize != f_bsize. Eventually we want to
+ * report the value of wtmult in this field.
+ */
+ buf->f_frsize = sb->s_blocksize;
+
+ /*
+ * On most *nix systems, f_blocks, f_bfree, and f_bavail
+ * are reported in units of f_frsize. Linux hasn't had
+ * an f_frsize field in its statfs struct until recently,
+ * thus historically Linux's sys_statfs reports these
+ * fields in units of f_bsize.
+ */
buf->f_bsize = sb->s_blocksize;
blockbits = sb->s_blocksize_bits;
blockres = (1 << blockbits) - 1;
buf->f_blocks = (res.tbytes + blockres) >> blockbits;
buf->f_bfree = (res.fbytes + blockres) >> blockbits;
buf->f_bavail = (res.abytes + blockres) >> blockbits;
+
buf->f_files = res.tfiles;
buf->f_ffree = res.afiles;