From: wang di Date: Fri, 22 Aug 2014 03:47:26 +0000 (-0700) Subject: LU-4179 mdt: skip open lock enqueue during resent X-Git-Tag: 2.4.2-RC1~20 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=354e7458b48271d827c3009ea707666f9bdc4a38;p=fs%2Flustre-release.git LU-4179 mdt: skip open lock enqueue during resent Skip open lock enqueue, if the open lock has been acquired(mdt_intent_fixup_resent) during resent. Signed-off-by: wang di Change-Id: I625ca438e28520416ee2af884d0a9f9e6f21cf2e Reviewed-on: http://review.whamcloud.com/8173 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 6c32303..77e9f15 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1697,15 +1697,22 @@ int mdt_reint_open(struct mdt_thread_info *info, struct mdt_lock_handle *lhc) } } - LASSERT(!lustre_handle_is_used(&lhc->mlh_reg_lh)); - - /* get openlock if this is not replay and if a client requested it */ - if (!req_is_replay(req)) { - rc = mdt_object_open_lock(info, child, lhc, &ibits); - if (rc != 0) - GOTO(out_child, result = rc); - else if (create_flags & MDS_OPEN_LOCK) + if (lustre_handle_is_used(&lhc->mlh_reg_lh)) { + /* the open lock might already be gotten in + * mdt_intent_fixup_resent */ + LASSERT(lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT); + if (create_flags & MDS_OPEN_LOCK) mdt_set_disposition(info, ldlm_rep, DISP_OPEN_LOCK); + } else { + /* get openlock if this isn't replay and client requested it */ + if (!req_is_replay(req)) { + rc = mdt_object_open_lock(info, child, lhc, &ibits); + if (rc != 0) + GOTO(out_child, result = rc); + else if (create_flags & MDS_OPEN_LOCK) + mdt_set_disposition(info, ldlm_rep, + DISP_OPEN_LOCK); + } } /* Try to open it now. */