From 551c01b97400cb8cabf22c6eaba64606c1d199b5 Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Fri, 28 May 2010 23:10:36 +0200 Subject: [PATCH] b=22244 fix ref count issue --- lustre/ldlm/ldlm_lockd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 56a8421..b582c66 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -1629,14 +1629,10 @@ static int __ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_bl_work_it } spin_unlock(&blp->blp_lock); - if (mode == LDLM_SYNC) { - /* keep ref count as object is on this stack for SYNC call */ - ldlm_bl_work_item_get(blwi); - cfs_waitq_signal(&blp->blp_waitq); + cfs_waitq_signal(&blp->blp_waitq); + + if (mode == LDLM_SYNC) wait_for_completion(&blwi->blwi_comp); - } else { - cfs_waitq_signal(&blp->blp_waitq); - } RETURN(0); } @@ -1653,7 +1649,8 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns, */ struct ldlm_bl_work_item blwi; memset(&blwi, 0, sizeof(blwi)); - /* have extra ref as this obj is on stack */ + /* take extra ref as this obj is on stack */ + ldlm_bl_work_item_get(&blwi); RETURN(__ldlm_bl_to_thread(ns, &blwi, ld, lock, cancels, count, mode)); } else { struct ldlm_bl_work_item *blwi; -- 1.8.3.1