Whamcloud - gitweb
LU-11158 mdt: grow lvb buffer to hold layout
[fs/lustre-release.git] / lustre / quota / qmt_lock.c
index 50fa1b3..9f68426 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2016, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -140,7 +140,7 @@ int qmt_intent_policy(const struct lu_env *env, struct lu_device *ld,
        /* on success, pack lvb in reply */
        lvb = req_capsule_server_get(&req->rq_pill, &RMF_DLM_LVB);
        lvb_len = ldlm_lvbo_size(*lockp);
-       lvb_len = ldlm_lvbo_fill(*lockp, lvb, lvb_len);
+       lvb_len = ldlm_lvbo_fill(env, *lockp, lvb, &lvb_len);
        if (lvb_len < 0)
                GOTO(out, rc = lvb_len);
 
@@ -631,9 +631,17 @@ void qmt_glb_lock_notify(const struct lu_env *env, struct lquota_entry *lqe,
        /* send glimpse callback to notify slaves of new quota settings */
        qti->qti_gl_desc.lquota_desc.gl_id        = lqe->lqe_id;
        qti->qti_gl_desc.lquota_desc.gl_flags     = 0;
-       qti->qti_gl_desc.lquota_desc.gl_hardlimit = lqe->lqe_hardlimit;
-       qti->qti_gl_desc.lquota_desc.gl_softlimit = lqe->lqe_softlimit;
-       qti->qti_gl_desc.lquota_desc.gl_time      = lqe->lqe_gracetime;
+       if (lqe->lqe_is_default) {
+               qti->qti_gl_desc.lquota_desc.gl_hardlimit = 0;
+               qti->qti_gl_desc.lquota_desc.gl_softlimit = 0;
+               qti->qti_gl_desc.lquota_desc.gl_time = LQUOTA_GRACE_FLAG(0,
+                                                       LQUOTA_FLAG_DEFAULT);
+
+       } else {
+               qti->qti_gl_desc.lquota_desc.gl_hardlimit = lqe->lqe_hardlimit;
+               qti->qti_gl_desc.lquota_desc.gl_softlimit = lqe->lqe_softlimit;
+               qti->qti_gl_desc.lquota_desc.gl_time = lqe->lqe_gracetime;
+       }
        qti->qti_gl_desc.lquota_desc.gl_ver       = ver;
 
        /* look up ldlm resource associated with global index */