From owner-freebsd-questions Thu May 23 15:13:19 2002 Delivered-To: freebsd-questions@freebsd.org Received: from lists.samba.org (samba.sourceforge.net [198.186.203.85]) by hub.freebsd.org (Postfix) with ESMTP id DBBBB37B405 for ; Thu, 23 May 2002 15:13:13 -0700 (PDT) Received: by lists.samba.org (Postfix, from userid 1001) id 11D3C411E; Thu, 23 May 2002 15:16:07 -0700 (PDT) Date: Thu, 23 May 2002 15:16:07 -0700 To: Michail Vidiassov Cc: samba-technical@samba.org, freebsd-questions@freebsd.org Subject: Re: zero size of mapped drives on samba2.2.4 with quotas Message-ID: <20020523151607.V25344@va.samba.org> References: <20020523222241.Q11202-100000@serv.iaas.msu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020523222241.Q11202-100000@serv.iaas.msu.ru>; from master@iaas.msu.ru on Thu, May 23, 2002 at 10:39:45PM +0400 From: jra@samba.org (Jeremy Allison) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, May 23, 2002 at 10:39:45PM +0400, Michail Vidiassov wrote: > 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 1.149.4.75 > retrieving revision 1.149.4.76 > diff -u -r1.149.4.75 -r1.149.4.76 > --- samba/source/smbd/trans2.c 2002/04/12 01:33:08 1.149.4.75 > +++ samba/source/smbd/trans2.c 2002/04/12 15:34:01 1.149.4.76 > @@ -1421,12 +1421,13 @@ > case SMB_QUERY_FS_SIZE_INFO: > case SMB_FS_SIZE_INFORMATION: > { > - SMB_BIG_UINT dfree,dsize,bsize; > + SMB_BIG_UINT dfree,dsize,bsize,secs_per_unit;; > data_len = 24; > conn->vfs_ops.disk_free(conn,".",False,&bsize,&dfree,&dsize); > - 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); > SIVAL(pdata,20,512); > break; > } > > 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. Can you try applying the following patch - this may not be the correct fix - I'm checking with tridge (who wrote the original code) to be sure. Thanks, Jeremy. -------------------------------------------------------------------- Index: smbd/trans2.c =================================================================== RCS file: /data/cvs/samba/source/smbd/trans2.c,v retrieving revision 1.149.4.80 diff -u -r1.149.4.80 trans2.c --- smbd/trans2.c 2002/05/20 16:41:45 1.149.4.80 +++ smbd/trans2.c 2002/05/23 22:14:45 @@ -1439,6 +1439,12 @@ SMB_BIG_UINT dfree,dsize,bsize,secs_per_unit;; data_len = 24; conn->vfs_ops.disk_free(conn,".",False,&bsize,&dfree,&dsize); + if (bsize < 1024) { + SMB_BIG_UINT factor = 1024/bsize; + bsize = 1024; + dsize /= factor; + dfree /= factor; + } secs_per_unit = 2; SBIG_UINT(pdata,0,dsize*(bsize/(512*secs_per_unit))); SBIG_UINT(pdata,8,dfree*(bsize/(512*secs_per_unit))); -------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message