From: jcl Date: Mon, 15 Apr 2013 20:21:13 +0000 (+0200) Subject: LU-3200 mdc: layout lock rpc must not take rpc_lock X-Git-Tag: 2.4.51~45 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a104459086c0e550e11d73eba635a72a1a282eb0 LU-3200 mdc: layout lock rpc must not take rpc_lock When a client issue an RPC to get a layout lock, it must not hold rpc_lock because in case of a restore the rpc can be blocking for a long time Signed-off-by: JC Lafoucriere Change-Id: Id9ea9be47669fd52c8d6e681090b4c911cfe2dc1 Reviewed-on: http://review.whamcloud.com/6115 Tested-by: Hudson Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: Johann Lombardi --- diff --git a/lustre/include/lustre_mdc.h b/lustre/include/lustre_mdc.h index 880df96..6cb5f01 100644 --- a/lustre/include/lustre_mdc.h +++ b/lustre/include/lustre_mdc.h @@ -88,7 +88,8 @@ static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck, { ENTRY; - if (it != NULL && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP)) + if (it != NULL && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP || + it->it_op == IT_LAYOUT)) return; /* This would normally block until the existing request finishes. @@ -125,7 +126,8 @@ static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck, static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck, struct lookup_intent *it) { - if (it != NULL && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP)) + if (it != NULL && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP || + it->it_op == IT_LAYOUT)) goto out; if (lck->rpcl_it == MDC_FAKE_RPCL_IT) { /* OBD_FAIL_MDC_RPCS_SEM */ diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index c3938cf..f2d666f 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -890,7 +890,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp, struct mdt_body *mdt_body; struct ldlm_lock *lock; int rc; - + ENTRY; LASSERT(request != NULL); LASSERT(request != LP_POISON);