From 3f4ca2cb52dc9c88c8061d8b907b6f793d604f6c Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Thu, 31 Jul 2014 10:24:50 +0200 Subject: [PATCH] LU-5436 quota: use OBD_SLAB_FREE_PTR() to free lqe 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 Change-Id: I07effa69ae877537b5339fe1c20fabce44468822 Reviewed-on: http://review.whamcloud.com/11289 Tested-by: Jenkins Reviewed-by: Niu Yawei Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/quota/lquota_internal.h | 5 +++-- lustre/quota/qsd_lock.c | 2 +- lustre/quota/qsd_reint.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lustre/quota/lquota_internal.h b/lustre/quota/lquota_internal.h index 08b15ed..490b1bc 100644 --- a/lustre/quota/lquota_internal.h +++ b/lustre/quota/lquota_internal.h @@ -216,6 +216,8 @@ struct lquota_site { #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) { @@ -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)) - OBD_FREE_PTR(lqe); + OBD_SLAB_FREE_PTR(lqe, lqe_kmem); } 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 *); -extern struct kmem_cache *lqe_kmem; /* lquota_entry.c */ /* site create/destroy */ diff --git a/lustre/quota/qsd_lock.c b/lustre/quota/qsd_lock.c index 8842eeb..d72d800 100644 --- a/lustre/quota/qsd_lock.c +++ b/lustre/quota/qsd_lock.c @@ -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; - 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; diff --git a/lustre/quota/qsd_reint.c b/lustre/quota/qsd_reint.c index 428b1a6..c4c6e11 100644 --- a/lustre/quota/qsd_reint.c +++ b/lustre/quota/qsd_reint.c @@ -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) { - 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); } @@ -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) - 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: -- 1.8.3.1