Subject: Trying to fix smbfs (statvfs, PR bin/25319) problem.
To: None <>
From: Juan RP <>
List: tech-kern
Date: 05/23/2004 09:33:57
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Hi there!

I'm trying to find out why smbfs doesn't show the correct values, when
using df(1) (the problem was explained in PR bin/25319), and I need
some help...

The original partition where I have a smbfs dir exported is:

/dev/wd0f     15877978  9646046   5438032    63%    /home

Using rev 1.21 of sys/fs/smbfs/smfs_smb.c gives me the half of the total
size in the fields total/used/free... it's currently showing it wrong.

So, I applied this patch:

Index: smbfs_smb.c
RCS file: /cvsroot/src/sys/fs/smbfs/smbfs_smb.c,v
retrieving revision 1.21
diff -u -r1.21 smbfs_smb.c
--- smbfs_smb.c 26 Apr 2004 17:08:45 -0000      1.21
+++ smbfs_smb.c 23 May 2004 07:27:54 -0000
@@ -213,7 +213,7 @@
        md_get_uint32le(mdp, &funits);
        md_get_uint16le(mdp, &bsize);
        sbp->f_bsize = bpu * bsize;     /* fundamental file system block size */
-       sbp->f_frsize = bsize;          /* fundamental file system frag size */
+       sbp->f_frsize = bpu * bsize;    /* fundamental file system frag size */
        sbp->f_iosize = bsize;          /* I/O size */
        sbp->f_blocks= units;           /* total data blocks in file system */
        sbp->f_bfree = funits;          /* free blocks in fs */

And now, the output on the client (using mount_smbfs) is much better than

//GUEST@MANDYLION/PUBLIC          15877888 10439936   5437952    65%   

The fields TOTAL/FREE now are more or less correct (it's not exact yet), but
not the USED one, because it's missing the blocks reserved for root...

My question is... how do I know how many blocks are currently reserved for root
in this partition?

	Juan RP <>

Content-Type: application/pgp-signature

Version: GnuPG v1.2.4 (NetBSD)