X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_hsm_cdt_agent.c;h=c97be7100e36c2577a679e903ee14df9447402fa;hb=c13ddec8e1cd3a63c16e08f28749771200b92f1b;hp=895feb77661a962cbf99c80923d94d25cfaa6cf7;hpb=fd4ab6e6ae877c88e46c35c517349285aa6226d2;p=fs%2Flustre-release.git diff --git a/lustre/mdt/mdt_hsm_cdt_agent.c b/lustre/mdt/mdt_hsm_cdt_agent.c index 895feb7..c97be71 100644 --- a/lustre/mdt/mdt_hsm_cdt_agent.c +++ b/lustre/mdt/mdt_hsm_cdt_agent.c @@ -406,6 +406,33 @@ int mdt_hsm_agent_send(struct mdt_thread_info *mti, hai->hai_cookie, rc); GOTO(out_buf, rc); } + + /* if restore and record status updated, give + * 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, + &hai->hai_fid); + 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, + &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); + } } } }