Whamcloud - gitweb
LU-5436 quota: use OBD_SLAB_FREE_PTR() to free lqe 89/11289/2
authorJohann Lombardi <johann.lombardi@intel.com>
Thu, 31 Jul 2014 08:24:50 +0000 (10:24 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 Aug 2014 03:51:39 +0000 (03:51 +0000)
lquota entries are allocated with OBD_SLAB_ALLOC_PTR() and should be
freed with OBD_SLAB_FREE_PTR() instead of OBD_FREE_PTR().
This issue has no real side effect since the Linux VM picks up the
correct slab.
This patch also fixes some incorrect error messages.

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: I07effa69ae877537b5339fe1c20fabce44468822
Reviewed-on: http://review.whamcloud.com/11289
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/quota/lquota_internal.h
lustre/quota/qsd_lock.c
lustre/quota/qsd_reint.c

index 08b15ed..490b1bc 100644 (file)
@@ -216,6 +216,8 @@ struct lquota_site {
 #define LQUOTA_BUMP_VER 0x1
 #define LQUOTA_SET_VER  0x2
 
 #define LQUOTA_BUMP_VER 0x1
 #define LQUOTA_SET_VER  0x2
 
+extern struct kmem_cache *lqe_kmem;
+
 /* helper routine to get/put reference on lquota_entry */
 static inline void lqe_getref(struct lquota_entry *lqe)
 {
 /* helper routine to get/put reference on lquota_entry */
 static inline void lqe_getref(struct lquota_entry *lqe)
 {
@@ -228,7 +230,7 @@ static inline void lqe_putref(struct lquota_entry *lqe)
        LASSERT(lqe != NULL);
        LASSERT(atomic_read(&lqe->lqe_ref) > 0);
        if (atomic_dec_and_test(&lqe->lqe_ref))
        LASSERT(lqe != NULL);
        LASSERT(atomic_read(&lqe->lqe_ref) > 0);
        if (atomic_dec_and_test(&lqe->lqe_ref))
-               OBD_FREE_PTR(lqe);
+               OBD_SLAB_FREE_PTR(lqe, lqe_kmem);
 }
 
 static inline int lqe_is_master(struct lquota_entry *lqe)
 }
 
 static inline int lqe_is_master(struct lquota_entry *lqe)
@@ -368,7 +370,6 @@ struct dt_object *acct_obj_lookup(const struct lu_env *, struct dt_device *,
 void lquota_generate_fid(struct lu_fid *, int, int, int);
 int lquota_extract_fid(const struct lu_fid *, int *, int *, int *);
 const struct dt_index_features *glb_idx_feature(struct lu_fid *);
 void lquota_generate_fid(struct lu_fid *, int, int, int);
 int lquota_extract_fid(const struct lu_fid *, int *, int *, int *);
 const struct dt_index_features *glb_idx_feature(struct lu_fid *);
-extern struct kmem_cache *lqe_kmem;
 
 /* lquota_entry.c */
 /* site create/destroy */
 
 /* lquota_entry.c */
 /* site create/destroy */
index 8842eeb..d72d800 100644 (file)
@@ -311,7 +311,7 @@ static int qsd_id_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *de
                struct lu_env           *env;
                struct lquota_entry     *lqe;
 
                struct lu_env           *env;
                struct lquota_entry     *lqe;
 
-               LDLM_DEBUG(lock, "canceling global quota lock");
+               LDLM_DEBUG(lock, "canceling ID quota lock");
                lqe = qsd_id_ast_data_get(lock, true);
                if (lqe == NULL)
                        break;
                lqe = qsd_id_ast_data_get(lock, true);
                if (lqe == NULL)
                        break;
index 428b1a6..c4c6e11 100644 (file)
@@ -497,7 +497,7 @@ static int qsd_reint_main(void *args)
        if (qqi->qqi_slv_ver != qti->qti_slv_ver) {
                rc = qsd_reint_index(env, qqi, false);
                if (rc) {
        if (qqi->qqi_slv_ver != qti->qti_slv_ver) {
                rc = qsd_reint_index(env, qqi, false);
                if (rc) {
-                       CWARN("%s: Reint slave for "DFID" failed. %d\n",
+                       CWARN("%s: reintegration for "DFID" failed with %d\n",
                              qsd->qsd_svname, PFID(&qqi->qqi_slv_fid), rc);
                        GOTO(out_lock, rc);
                }
                              qsd->qsd_svname, PFID(&qqi->qqi_slv_fid), rc);
                        GOTO(out_lock, rc);
                }
@@ -515,8 +515,8 @@ static int qsd_reint_main(void *args)
        /* Step 4: start reconciliation for each enforced ID */
        rc = qsd_reconciliation(env, qqi);
        if (rc)
        /* Step 4: start reconciliation for each enforced ID */
        rc = qsd_reconciliation(env, qqi);
        if (rc)
-               CWARN("%s: reconciliation failed. "DFID", %d\n",
-                     qsd->qsd_svname, PFID(&qti->qti_fid), rc);
+               CWARN("%s: reconciliation for "DFID" failed with %d\n",
+                     qsd->qsd_svname, PFID(&qqi->qqi_slv_fid), rc);
 
        EXIT;
 out_lock:
 
        EXIT;
 out_lock: