From: Bruno Faccini Date: Tue, 20 May 2014 15:50:23 +0000 (+0200) Subject: LU-2827 mdt: Also handle resend for layout-lock X-Git-Tag: 2.6.0-RC1~75 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1490e22dd1bebd043e1b819f89011b1097dcf289 LU-2827 mdt: Also handle resend for layout-lock This patch is an add-on to the generic fix for resends handling known as : Lustre-commit: I9a23c13313d5168d0c232fdc0acbdab330089356 Lustre-change: http://review.whamcloud.com/5978/ This patch adds handling of resend during layout-lock Signed-off-by: Bruno Faccini Change-Id: Ideb551779a884d77ded8036c513f62557b2dfcde Reviewed-on: http://review.whamcloud.com/10378 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Vitaly Fertman Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 6cd5f51..91c2207 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3235,6 +3235,7 @@ static int mdt_intent_layout(enum mdt_it_code opcode, struct ldlm_lock **lockp, __u64 flags) { + struct mdt_lock_handle *lhc = &info->mti_lh[MDT_LH_LAYOUT]; struct layout_intent *layout; struct lu_fid *fid; struct mdt_object *obj = NULL; @@ -3250,6 +3251,9 @@ static int mdt_intent_layout(enum mdt_it_code opcode, fid = &info->mti_tmp_fid2; fid_extract_from_res_name(fid, &(*lockp)->l_resource->lr_name); + /* Get lock from request for possible resent case. */ + mdt_intent_fixup_resent(info, *lockp, lhc, flags); + obj = mdt_object_find(info->mti_env, info->mti_mdt, fid); if (IS_ERR(obj)) RETURN(PTR_ERR(obj)); @@ -3272,11 +3276,14 @@ static int mdt_intent_layout(enum mdt_it_code opcode, if (rc != 0) RETURN(-EINVAL); + if (lustre_handle_is_used(&lhc->mlh_reg_lh)) + rc = mdt_intent_lock_replace(info, lockp, lhc, flags); + layout = req_capsule_client_get(info->mti_pill, &RMF_LAYOUT_INTENT); LASSERT(layout != NULL); if (layout->li_opc == LAYOUT_INTENT_ACCESS) - /* return to normal ldlm handling */ - RETURN(0); + /* return to normal/resent ldlm handling */ + RETURN(rc); CERROR("%s: Unsupported layout intent (%d)\n", mdt_obd_name(info->mti_mdt), layout->li_opc);