X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flmv%2Flmv_intent.c;h=096f83ae7de9b328d814c373d8dd4c95bcf6f272;hp=212a8b207d850ef90d7b76a8babdb0818bb2ab78;hb=f2e4d30a95f4fdb55d18da097c24d441e564c579;hpb=2fbf36f5e3890d8b560b5682931999f229021b2d diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index 212a8b2..096f83a 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -537,5 +537,27 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, else LBUG(); + if (rc < 0) { + struct lustre_handle lock_handle; + + if (it->d.lustre.it_lock_mode != 0) { + lock_handle.cookie = it->d.lustre.it_lock_handle; + ldlm_lock_decref(&lock_handle, + it->d.lustre.it_lock_mode); + } + + it->d.lustre.it_lock_handle = 0; + it->d.lustre.it_lock_mode = 0; + + if (it->d.lustre.it_remote_lock_mode != 0) { + lock_handle.cookie = it->d.lustre.it_remote_lock_handle; + ldlm_lock_decref(&lock_handle, + it->d.lustre.it_remote_lock_mode); + } + + it->d.lustre.it_remote_lock_handle = 0; + it->d.lustre.it_remote_lock_mode = 0; + } + RETURN(rc); }