Linux xfs group quota Patch for Samba 2.2.8a

Heinreichsberger, Helmut Helmut.Heinreichsberger at
Tue Nov 18 20:44:18 GMT 2003

I found, that Samba 2.2.8a dosn't support group quotas on XFS filesystems.
When you have many projects and you have to resize the available space then
ist is the best way to use group quotas and a large disk array.
But the shown available space is wrong.
This patch corrects the problem of the displayed disk size and available

quotas.c.orig ist the original quotas.c from samba 2.2.8a

--- quotas.c.orig	Tue Nov 18 20:21:53 2003
+++ quotas.c	Tue Nov 18 20:26:10 2003
@@ -71,8 +71,18 @@
        int ret = -1;
        struct fs_disk_quota D;
+	   gid_t egrp_id;
+	   egrp_id = getegid();
+       ret = quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), path, euser_id,
+       /* As XFS has group quotas, if getting the user
+          quota fails, try getting the group instead. */
+	   if (ret)
+           ret = quotactl(QCMD(Q_XGETQUOTA,GRPQUOTA), path, egrp_id,
-       if ((ret = quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), path, euser_id,
-               return ret;
+	   if (ret)
+		   return ret;
        dp->bsize = (SMB_BIG_UINT)512;

Helmut Heinreichsberger
Email: Helmut.Heinreichsberger at

More information about the samba-technical mailing list