From: Hongchao Zhang Date: Sun, 21 Apr 2013 13:12:52 +0000 (+0800) Subject: LU-3142 mdt: update mdt_max_mdsize in mdt_lvbo_size X-Git-Tag: 2.3.65~61 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=507dc8765e36e4cad6c808ad6e6ce28b8f4e395c LU-3142 mdt: update mdt_max_mdsize in mdt_lvbo_size during calling mdt_lvbo_size to get the size of lsm, mdt_max_mdsize could be less than the lsm size of this object in failover mode. then it is needed to check and update this value. Test-Parameters: envdefinitions=RECOVERY_MDS_SCALE_EXCEPT=failover_ost \ clientdistro=el6 serverdistro=el6 clientarch=x86_64 serverarch=x86_64 \ clientcount=4 osscount=2 mdscount=2 austeroptions=-R failover=true \ useiscsi=true testlist=recovery-mds-scale Change-Id: Id490c346ca9f34edcc963334e396678f1b41562c Signed-off-by: Hongchao Zhang Signed-off-by: Jian Yu Reviewed-on: http://review.whamcloud.com/6102 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index f42fda5..53545e0 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3720,6 +3720,9 @@ static int mdt_intent_layout(enum mdt_it_code opcode, __u64 flags) { struct layout_intent *layout; + struct lu_fid *fid; + struct mdt_object *obj = NULL; + struct md_object *child = NULL; int rc; ENTRY; @@ -3729,6 +3732,26 @@ static int mdt_intent_layout(enum mdt_it_code opcode, RETURN(-EINVAL); } + fid = &info->mti_tmp_fid2; + fid_build_from_res_name(fid, &(*lockp)->l_resource->lr_name); + + obj = mdt_object_find(info->mti_env, info->mti_mdt, fid); + if (IS_ERR(obj)) + RETURN(PTR_ERR(obj)); + + if (mdt_object_exists(obj) && !mdt_object_remote(obj)) { + child = mdt_object_child(obj); + + /* get the length of lsm */ + rc = mo_xattr_get(info->mti_env, child, &LU_BUF_NULL, + XATTR_NAME_LOV); + + if (rc > info->mti_mdt->mdt_max_mdsize) + info->mti_mdt->mdt_max_mdsize = rc; + } + + mdt_object_put(info->mti_env, obj); + (*lockp)->l_lvb_type = LVB_T_LAYOUT; req_capsule_set_size(info->mti_pill, &RMF_DLM_LVB, RCL_SERVER, ldlm_lvbo_size(*lockp));