Whamcloud - gitweb
LU-3415 quota: not enforce quota when accounting disabled
authorNiu Yawei <yawei.niu@intel.com>
Thu, 30 May 2013 03:46:28 +0000 (23:46 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 10 Jun 2013 01:53:26 +0000 (21:53 -0400)
When quota accounting isn't enabled, don't try to enforce quota.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I9a74b7bfe6b2981adf501042efb6867a77ee4044
Reviewed-on: http://review.whamcloud.com/6492
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/quota/qsd_handler.c

index 805be89..be212cf 100644 (file)
@@ -849,8 +849,10 @@ int qsd_op_begin(const struct lu_env *env, struct qsd_instance *qsd,
 
        /* ignore quota enforcement request when:
         *    - quota isn't enforced for this quota type
 
        /* ignore quota enforcement request when:
         *    - quota isn't enforced for this quota type
-        * or - the user/group is root */
-       if (!qsd_type_enabled(qsd, qi->lqi_type) || qi->lqi_id.qid_uid == 0)
+        * or - the user/group is root
+        * or - quota accounting isn't enabled */
+       if (!qsd_type_enabled(qsd, qi->lqi_type) || qi->lqi_id.qid_uid == 0 ||
+           qsd->qsd_acct_failed)
                RETURN(0);
 
        LASSERTF(trans->lqt_id_cnt <= QUOTA_MAX_TRANSIDS, "id_cnt=%d",
                RETURN(0);
 
        LASSERTF(trans->lqt_id_cnt <= QUOTA_MAX_TRANSIDS, "id_cnt=%d",