From 57cc12fd395f5a766e31f52b23911fc71938cbdc Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 19 Apr 2017 10:49:23 -0500 Subject: [PATCH] LU-9312 hsm: release restore lock without object In the error path of mdt_hsm_agent_send(), the object to be restored is not needed to release the layout lock so don't find it. Signed-off-by: John L. Hammond Change-Id: Ic8e82a5ccd8f83cac2d7ebc3d4b800f8a4563ca6 Reviewed-on: https://review.whamcloud.com/26742 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Faccini Bruno Reviewed-by: Henri Doreau Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_hsm_cdt_agent.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lustre/mdt/mdt_hsm_cdt_agent.c b/lustre/mdt/mdt_hsm_cdt_agent.c index a28a932..d73b20a 100644 --- a/lustre/mdt/mdt_hsm_cdt_agent.c +++ b/lustre/mdt/mdt_hsm_cdt_agent.c @@ -519,7 +519,6 @@ int mdt_hsm_agent_send(struct mdt_thread_info *mti, * back granted layout lock */ if (hai->hai_action == HSMA_RESTORE) { struct cdt_restore_handle *crh = NULL; - struct mdt_object *obj = NULL; mutex_lock(&cdt->cdt_restore_lock); crh = mdt_hsm_restore_hdl_find(cdt, @@ -527,17 +526,12 @@ int mdt_hsm_agent_send(struct mdt_thread_info *mti, if (crh != NULL) list_del(&crh->crh_list); mutex_unlock(&cdt->cdt_restore_lock); - obj = mdt_object_find(mti->mti_env, - mti->mti_mdt, - &hai->hai_fid); - if (!IS_ERR(obj) && crh != NULL) - mdt_object_unlock(mti, obj, + if (crh != NULL) { + mdt_object_unlock(mti, NULL, &crh->crh_lh, 1); - if (crh != NULL) OBD_SLAB_FREE_PTR(crh, mdt_hsm_cdt_kmem); - if (!IS_ERR(obj)) - mdt_object_put(mti->mti_env, obj); + } } } } -- 1.8.3.1