]> arthur.barton.de Git - netatalk.git/commitdiff
quotas: improve Linux quota behaviour
authorRalph Boehme <rb@sernet.de>
Wed, 30 Apr 2014 12:33:58 +0000 (14:33 +0200)
committerRalph Boehme <rb@sernet.de>
Tue, 20 May 2014 16:05:06 +0000 (18:05 +0200)
Signed-off-by: Ralph Boehme <rb@sernet.de>
NEWS
etc/afpd/quota.c

diff --git a/NEWS b/NEWS
index b38b278cfc07c798659f6af45ac7199c321c0f8a..da5a0e71448101f8d20cadcde040ae5a6218ee1e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Changes in 3.1.2
 * FIX: Improve reliability of afpd child handler
 * FIX: debian initscript: add 0 and 6 to Default-Stop. debian-bug#745520
 * FIX: put the Solaris share reservation after our locking stuff, bug #560.
+* UPD: Improve Linux quota behaviour
 
 Changes in 3.1.1
 ================
index 614a7f95e74956a6d5881b4b35b0915cf20c3fe4..bab14e1345baf9a9f8b9447518ab1233b7f7650b 100644 (file)
@@ -510,6 +510,7 @@ static int getfsquota(const AFPObj *obj, struct vol *vol, const int uid, struct
     struct quotctl      qc;
 #endif
 
+    memset(dq, 0, sizeof(struct dqblk));
     memset(&dqg, 0, sizeof(dqg));
        
 #ifdef __svr4__
@@ -558,7 +559,9 @@ static int getfsquota(const AFPObj *obj, struct vol *vol, const int uid, struct
 
 #else /* BSD4_4 */
     if (get_linux_quota (WANT_USER_QUOTA, vol->v_gvs, uid, dq) !=0) {
-        return( AFPERR_PARAM );
+#ifdef DEBUG_QUOTA
+        LOG(log_debug, logtype_afpd, "user quota did not work!" );
+#endif /* DEBUG_QUOTA */
     }
 
     if (get_linux_quota(WANT_GROUP_QUOTA, vol->v_gvs, getegid(),  &dqg) != 0) {
@@ -590,10 +593,15 @@ static int getfsquota(const AFPObj *obj, struct vol *vol, const int uid, struct
       ) /* if */
     {
         /* use group quota limits rather than user limits */
-        dq->dqb_curblocks = dqg.dqb_curblocks;
         dq->dqb_bhardlimit = dqg.dqb_bhardlimit;
         dq->dqb_bsoftlimit = dqg.dqb_bsoftlimit;
-        dq->dqb_btimelimit = dqg.dqb_btimelimit;
+        dq->dqb_curblocks = dqg.dqb_curblocks;
+        dq->dqb_ihardlimit = dqg.dqb_ihardlimit;
+        dq->dqb_isoftlimit = dqg.dqb_isoftlimit;
+        dq->dqb_curinodes = dqg.dqb_curinodes;
+        dq->dqb_btime = dqg.dqb_btime;
+        dq->dqb_itime = dqg.dqb_itime;
+        dq->bsize = dqg.bsize;
     } /* if */
 
 #endif /* TRU64 */