Linux xfs group quota Patch for Samba 2.2.8a

Heinreichsberger, Helmut Helmut.Heinreichsberger at wincor-nixdorf.com
Tue Nov 18 20:44:18 GMT 2003


Hi,
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
space

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;
+
        ZERO_STRUCT(D);
+	   egrp_id = getegid();
+
+       ret = quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), path, euser_id,
(caddr_t)&D);
+
+       /* 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,
(caddr_t)&D);
 
-       if ((ret = quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), path, euser_id,
(caddr_t)&D)))
-               return ret;
+	   if (ret)
+		   return ret;
 
        dp->bsize = (SMB_BIG_UINT)512;




Regards
Helmut Heinreichsberger
Email: Helmut.Heinreichsberger at chello.at



More information about the samba-technical mailing list