Subject: Trying to fix smbfs (statvfs, PR bin/25319) problem.
To: None <tech-kern@NetBSD.org>
From: Juan RP <juan@xtraeme.unixbsd.org>
List: tech-kern
Date: 05/23/2004 09:33:57
--Signature=_Sun__23_May_2004_09_33_57_+0200_LOqGBFGwRS3kNFiY
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
before:

//GUEST@MANDYLION/PUBLIC          15877888 10439936   5437952    65%   
/home/juan/smb/public

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 <juan@xtraeme.unixbsd.org>

--Signature=_Sun__23_May_2004_09_33_57_+0200_LOqGBFGwRS3kNFiY
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD8DBQFAsFPoypkLYVDran0RAjJtAJ914+6vWpQWdDY0/EqKg/DhsdGQWwCfR0G6
vipxDFQhQXXsl9DItsx4mG8=
=6WBm
-----END PGP SIGNATURE-----

--Signature=_Sun__23_May_2004_09_33_57_+0200_LOqGBFGwRS3kNFiY--