From 586a609c9d5a53e75174b66269c685f594ded7c2 Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Tue, 25 Mar 2014 08:31:56 -0400 Subject: [PATCH] LU-4008 mdt: Use actual size for layout lock intents The intent for layout looks up the size of the lov xattr. That size should be used for the reply buffer instead of the maximum size ever seen. Signed-off-by: Matt Ezell Signed-off-by: James Simmons Change-Id: I9550aa47313502288b018f5cac0d59931ce76d21 Reviewed-on: http://review.whamcloud.com/9571 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Fan Yong --- lustre/mdt/mdt_handler.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index abb526a..13ffb22 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3279,8 +3279,7 @@ static int mdt_intent_layout(enum mdt_it_code opcode, struct layout_intent *layout; struct lu_fid *fid; struct mdt_object *obj = NULL; - struct md_object *child = NULL; - int rc; + int rc = 0; ENTRY; if (opcode != MDT_IT_LAYOUT) { @@ -3297,11 +3296,10 @@ static int mdt_intent_layout(enum mdt_it_code opcode, 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); + rc = mdt_attr_get_eabuf_size(info, obj); + if (rc < 0) + RETURN(rc); if (rc > info->mti_mdt->mdt_max_mdsize) info->mti_mdt->mdt_max_mdsize = rc; @@ -3310,8 +3308,7 @@ static int mdt_intent_layout(enum mdt_it_code opcode, 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)); + req_capsule_set_size(info->mti_pill, &RMF_DLM_LVB, RCL_SERVER, rc); rc = req_capsule_server_pack(info->mti_pill); if (rc != 0) RETURN(-EINVAL); -- 1.8.3.1