Whamcloud - gitweb
LU-3200 mdc: layout lock rpc must not take rpc_lock
authorjcl <jacques-charles.lafoucriere@cea.fr>
Mon, 15 Apr 2013 20:21:13 +0000 (22:21 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 7 Jun 2013 03:54:18 +0000 (23:54 -0400)
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 <jacques-charles.lafoucriere@cea.fr>
Change-Id: Id9ea9be47669fd52c8d6e681090b4c911cfe2dc1
Reviewed-on: http://review.whamcloud.com/6115
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/include/lustre_mdc.h
lustre/mdc/mdc_locks.c

index 880df96..6cb5f01 100644 (file)
@@ -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 */
index c3938cf..f2d666f 100644 (file)
@@ -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);