From 6a1204f5d06c6499e171a2da30677e46c6057166 Mon Sep 17 00:00:00 2001 From: wang di Date: Fri, 1 Nov 2013 00:00:11 -0700 Subject: [PATCH 1/1] 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 Signed-off-by: Keith Mannthey Change-Id: I78228112b0ba8f93e05930fdd042763d77700626 Reviewed-on: http://review.whamcloud.com/8142 Tested-by: Jenkins Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_open.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 27e8fd8..bc3f42d 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1819,17 +1819,23 @@ 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_unlock, 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_unlock, result = rc); + else if (create_flags & MDS_OPEN_LOCK) + mdt_set_disposition(info, ldlm_rep, + DISP_OPEN_LOCK); + } } - /* Try to open it now. */ rc = mdt_finish_open(info, parent, child, create_flags, created, ldlm_rep); -- 1.8.3.1