Whamcloud - gitweb
LU-2197 quota: don't send preacq if no usage and no activity
authorJohann Lombardi <johann.lombardi@intel.com>
Tue, 16 Oct 2012 16:50:57 +0000 (18:50 +0200)
committerOleg Drokin <green@whamcloud.com>
Wed, 17 Oct 2012 14:43:19 +0000 (10:43 -0400)
Slaves should not try to pre-acquire quota space when the ID
has no usage and there is no outstanding activities.

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: I5076910024deca2a1dc75189837dd2b6cdabe7bf
Reviewed-on: http://review.whamcloud.com/4279
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qsd_handler.c

index 40c8cba..5bdb0cf 100644 (file)
@@ -158,7 +158,7 @@ static void qsd_dqacq_completion(const struct lu_env *env,
 
        lqe_write_lock(lqe);
 
-       LQUOTA_DEBUG(lqe, "DQACQ returned %d, flags:%x", ret,
+       LQUOTA_DEBUG(lqe, "DQACQ returned %d, flags:0x%x", ret,
                     reqbody->qb_flags);
 
        /* despite -EDQUOT & -EINPROGRESS errors, the master might still
@@ -167,8 +167,8 @@ static void qsd_dqacq_completion(const struct lu_env *env,
                if (ret != -ETIMEDOUT && ret != -ENOTCONN &&
                   ret != -ESHUTDOWN && ret != -EAGAIN)
                        /* print errors only if return code is unexpected */
-                       LQUOTA_ERROR(lqe, "DQACQ failed with %d, flags:%x", ret,
-                                    reqbody->qb_flags);
+                       LQUOTA_ERROR(lqe, "DQACQ failed with %d, flags:0x%x",
+                                    ret, reqbody->qb_flags);
                GOTO(out, ret);
        }
 
@@ -388,7 +388,7 @@ again:
                }
 
                if (!lqe->lqe_edquot && !lqe->lqe_nopreacq &&
-                   lustre_handle_is_used(&lqe->lqe_lockh) &&
+                   lustre_handle_is_used(&lqe->lqe_lockh) && usage > 0 &&
                    lqe->lqe_qunit != 0 && granted < usage + lqe->lqe_qtune) {
                        /* To pre-acquire quota space, we report how much spare
                         * quota space the slave currently owns, then the master