From: Ralph Boehme Date: Wed, 30 Apr 2014 12:33:58 +0000 (+0200) Subject: quotas: improve Linux quota behaviour X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=450114e8c52574c5444d856e8a0208f2bbaab80c quotas: improve Linux quota behaviour Signed-off-by: Ralph Boehme --- diff --git a/NEWS b/NEWS index b38b278c..da5a0e71 100644 --- 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 ================ diff --git a/etc/afpd/quota.c b/etc/afpd/quota.c index 614a7f95..bab14e13 100644 --- a/etc/afpd/quota.c +++ b/etc/afpd/quota.c @@ -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 */