X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_handler.c;h=c1e5ea82ff2c8b24db55cfed40c0ce03b72c2f15;hp=204ebd5425561b352e5585c5e979edc73788def5;hb=e77a7afe261cc2a9393adf4ffe59401c830d16ec;hpb=c4103771363fc66d75ad597b89c10f445057f777 diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 204ebd5..c1e5ea8 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1351,7 +1351,7 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, rc = mdt_check_resent_lock(info, child, lhc); if (rc < 0) { - RETURN(-EPROTO); + RETURN(rc); } else if (rc > 0) { mdt_lock_handle_init(lhc); mdt_lock_reg_init(lhc, LCK_PR); @@ -2329,8 +2329,14 @@ int mdt_check_resent_lock(struct mdt_thread_info *info, lock = ldlm_handle2lock(&lhc->mlh_reg_lh); LASSERT(lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT); - LASSERTF(lock != NULL, "Invalid lock handle "LPX64"\n", - lhc->mlh_reg_lh.cookie); + if (lock == NULL) { + /* Lock is pinned by ldlm_handle_enqueue0() as it is + * a resend case, however, it could be already destroyed + * due to client eviction or a raced cancel RPC. */ + LDLM_DEBUG_NOLOCK("Invalid lock handle "LPX64"\n", + lhc->mlh_reg_lh.cookie); + RETURN(-ESTALE); + } if (!fid_res_name_eq(mdt_object_fid(mo), &lock->l_resource->lr_name)) {