From: Johann Lombardi Date: Mon, 31 May 2010 23:18:28 +0000 (+0200) Subject: Revert "b=22244 fix ref count issue" X-Git-Tag: v1_8_3_53~24 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=33ad6f2367b57a481e0270332ba2ba083867b3a9;p=fs%2Flustre-release.git Revert "b=22244 fix ref count issue" This reverts commit 551c01b97400cb8cabf22c6eaba64606c1d199b5. Reverting all patches from 22244 & 21128 because of test failures. See 22244 for more info. --- diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index b582c66..56a8421 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -1629,10 +1629,14 @@ static int __ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_bl_work_it } spin_unlock(&blp->blp_lock); - cfs_waitq_signal(&blp->blp_waitq); - - if (mode == LDLM_SYNC) + 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); wait_for_completion(&blwi->blwi_comp); + } else { + cfs_waitq_signal(&blp->blp_waitq); + } RETURN(0); } @@ -1649,8 +1653,7 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns, */ struct ldlm_bl_work_item blwi; memset(&blwi, 0, sizeof(blwi)); - /* take extra ref as this obj is on stack */ - ldlm_bl_work_item_get(&blwi); + /* have extra ref as this obj is on stack */ RETURN(__ldlm_bl_to_thread(ns, &blwi, ld, lock, cancels, count, mode)); } else { struct ldlm_bl_work_item *blwi;