zero size of mapped drives on samba2.2.4 with quotas

Michail Vidiassov master at
Thu May 23 11:43:46 GMT 2002

Dear Guru,

I am running samba 2.2.4 on FreeBSD 4.5

The size of mapped drives with quota enabled is always shown as 0 by W2k.
There was no such problem with samba 2.2.3a.

As far as I undestand, th esource of the problem is the following change
of source/smbd/trans2.c (it was intended to
fixe the display of the 'size on disk' property of files from w2k):

RCS file: /cvsroot/samba/source/smbd/trans2.c,v
retrieving revision
retrieving revision
diff -u -r1.149.4.75 -r1.149.4.76
--- samba/source/smbd/trans2.c	2002/04/12 01:33:08
+++ samba/source/smbd/trans2.c	2002/04/12 15:34:01
@@ -1421,12 +1421,13 @@
-			SMB_BIG_UINT dfree,dsize,bsize;
+			SMB_BIG_UINT dfree,dsize,bsize,secs_per_unit;;
 			data_len = 24;
-			SBIG_UINT(pdata,0,dsize);
-			SBIG_UINT(pdata,8,dfree);
-			SIVAL(pdata,16,bsize/512);
+			secs_per_unit = 2;
+			SBIG_UINT(pdata,0,dsize*(bsize/(512*secs_per_unit)));
+			SBIG_UINT(pdata,8,dfree*(bsize/(512*secs_per_unit)));
+			SIVAL(pdata,16,secs_per_unit);

This code seems to have problems in case bsize=512.
It is the case with FreeBSD and disk quotas enabled.

Reversing the patch solves my disk size problem.

I seek confirmations / comments.

                                 Sincerely, Michail

More information about the samba-technical mailing list