XFS, Quotas and Samba

Nathan Scott nathans at sgi.com
Wed Sep 5 19:38:01 GMT 2001

hi Jan,

Just a quick followup - this is what I mentioned in my earlier
mail to you.  I think your new VFS quota code (as in Alan Cox's
series of 2.4 kernels, for the Samba folk) will have exactly the
same problem as XFS.  This "grep" would seem to confirm it - but
you'll know better than I here:

11:31 nathans at troppo ~/cvs/quota-tools 73> grep GETQUOTA dqblk*h
dqblk_rpc.h:#define Q_RPC_GETQUOTA      0x0300  /* get limits and usage */
dqblk_v1.h:#define Q_V1_GETQUOTA        0x300
dqblk_v2.h:#define Q_V2_GETQUOTA        0x0D00  /* Get limits and usage */
dqblk_xfs.h:#define Q_XFS_GETQUOTA      Q_XGETQUOTA
11:31 nathans at troppo ~/cvs/quota-tools 74> 

The samba code does a good old Q_GETQUOTA (ie. your V1 above).


On Thu, Sep 06, 2001 at 10:59:52AM +1100, Nathan Scott wrote:
> hi,
> On Wed, Sep 05, 2001 at 02:57:39PM +0100, Giddings, Bret wrote:
> > I am investigating whether I can replace my expensive Compaq Alphas file
> > servers with cheaper (and invariably faster given my budget) Intel based
> > ones. I have so far been pleased with the ease with which xfs has installed
> > and run on my hardware of choice. To make my life easier, I have picked up
> > the pre-built RedHat kernels with xfs support. Everything appears to be fine
> > except that when connecting to a share from Samba, the amount of free space
> > reported is the amount of free disk space left on the device rather than the
> > amount of free space in the users quota (this is on a disk mounted with
> > usrquota and a quota set for the users). The usual tools (edquota, setquota
> > work as expected).
> > 
> > I have downloaded the source rpm for samba and it appears that RedHat build
> > their smbd to support quotas. I have also checked whether
> > /usr/include/sys/quota.h is modified by installing your updated quota rpm
> > (quota-3.01pre8) and it isn't. So, is there another reason why quotas don't
> > appear to work with xfs/samba?
> The samba code needs to be updated to support XFS quota under
> Linux.  There was someone on the list a little while ago who
> was looking to add in the samba support for XFS quota, but I
> don't know how far they got.
> I know very little about samba unfortunately, but it should be
> quite simple to add this stuff for XFS - the disk_quotas()
> routine in samba-2.2.1a/source/smbd/quotas.c is all that needs
> to be changed, by the look of things.
> For XFS filesystems on Linux this needs to:
> - have logic to handle getmntent's of type "xfs" separately;
> - issue a quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), ..., &xdq) where
>   xdq is of type "struct fs_disk_quota_t" from <linux/xqm.h>
> - set *bsize to 512 for XFS
> - refer to the code later in that same file for dealing with XFS
>   on IRIX - basically, do exactly the same thing and it should
>   just work.
> - to do it properly, the configure scripts will need to check
>   for linux/xqm.h (or might be simpler to keep a local copy? -
>   I dunno what sort of policy the samba folk have on this sort of
>   thing, but this header isn't going to change and probably isn't
>   going to appear in the libc headers for quite awhile...)
> cheers.
> -- 
> Nathan


More information about the samba-technical mailing list