Patchwork [BUG:1021] Solaris: df -h returned invalid size

login
register
Submitter shishir gowda
Date 2010-11-16 05:42:58
Message ID <20101116054258.GA15394@dev.gluster.com>
Download mbox | patch
Permalink /patch/5705/
State Accepted
Headers show

Comments

shishir gowda - 2010-11-16 05:42:58
The reason seems to have been multiplying fields with f_bsize, while
they are in f_frsize units. On linux both f_bize and f_frbsize seems to
have been the same

Signed-off-by: shishir gowda <shishirng@gluster.com>
---
 xlators/nfs/server/src/nfs3-helpers.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 8e4ca37..8d7c66f 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -1090,8 +1090,8 @@  nfs3_fill_fsstat3res (fsstat3res *res, nfsstat3 stat, struct statvfs *fsbuf,
         nfs3_map_deviceid_to_statdev (postbuf, deviceid);
         poa = nfs3_stat_to_post_op_attr (postbuf);
         resok.tbytes = (size3)(fsbuf->f_frsize * fsbuf->f_blocks);
-        resok.fbytes = (size3)(fsbuf->f_bsize * fsbuf->f_bfree);
-        resok.abytes = (size3)(fsbuf->f_bsize * fsbuf->f_bavail);
+        resok.fbytes = (size3)(fsbuf->f_frsize * fsbuf->f_bfree);
+        resok.abytes = (size3)(fsbuf->f_frsize * fsbuf->f_bavail);
         resok.tfiles = (size3)(fsbuf->f_files);
         resok.ffiles = (size3)(fsbuf->f_ffree);
         resok.afiles = (size3)(fsbuf->f_favail);