s3-dfree-quota: remove special handling of EDQUOT
authorUri Simchoni <uri@samba.org>
Fri, 27 May 2016 19:15:46 +0000 (22:15 +0300)
committerJeremy Allison <jra@samba.org>
Tue, 31 May 2016 22:57:32 +0000 (00:57 +0200)
It is no longer part of the quota VFS interface to return
an EDQUOT error as an indication that getting quota succeeded
but the user/group is over-quota. A VFS module implementing
quota interface always returns 0 on success.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/quotas.c

index 20f74b4acebc299e2d51288627375edfe194e69f..9d3b9061e9b1eb840132696b51f83c391389a62f 100644 (file)
@@ -509,18 +509,11 @@ bool disk_quotas(connection_struct *conn, const char *path, uint64_t *bsize,
 
        r = SMB_VFS_GET_QUOTA(conn, path, SMB_USER_QUOTA_TYPE, id, &D);
 
-       /* Use softlimit to determine disk space, except when it has been exceeded */
-       *bsize = D.bsize;
        if (r == -1) {
-               if (errno == EDQUOT) {
-                       *dfree =0;
-                       *dsize =D.curblocks;
-                       return (True);
-               } else {
-                       goto try_group_quota;
-               }
+               goto try_group_quota;
        }
 
+       *bsize = D.bsize;
        /* Use softlimit to determine disk space, except when it has been exceeded */
        if (
                (D.softlimit && D.curblocks >= D.softlimit) ||
@@ -563,18 +556,11 @@ try_group_quota:
        ZERO_STRUCT(D);
        r = SMB_VFS_GET_QUOTA(conn, path, SMB_GROUP_QUOTA_TYPE, id, &D);
 
-       /* Use softlimit to determine disk space, except when it has been exceeded */
-       *bsize = D.bsize;
        if (r == -1) {
-               if (errno == EDQUOT) {
-                       *dfree =0;
-                       *dsize =D.curblocks;
-                       return (True);
-               } else {
-                       return False;
-               }
+               return False;
        }
 
+       *bsize = D.bsize;
        /* Use softlimit to determine disk space, except when it has been exceeded */
        if (
                (D.softlimit && D.curblocks >= D.softlimit) ||