XFS, Quotas and Samba

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


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...)



More information about the samba-technical mailing list