X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosp%2Fosp_md_object.c;h=65efd688ce283b436d37520c12d8882bac8ff9ae;hb=b50bb830f92e87da9bfdc84d14e4f3f78c80c9ac;hp=26996f6dc7e5860a37aa9a59dd53af5eb7004add;hpb=b32e55b600ca2c9bf8b62287d9f889791d157426;p=fs%2Flustre-release.git diff --git a/lustre/osp/osp_md_object.c b/lustre/osp/osp_md_object.c index 26996f6..65efd68 100644 --- a/lustre/osp/osp_md_object.c +++ b/lustre/osp/osp_md_object.c @@ -904,6 +904,8 @@ static int osp_md_object_lock(const struct lu_env *env, if (einfo->ei_nonblock) flags |= LDLM_FL_BLOCK_NOWAIT; + if (einfo->ei_mode & (LCK_EX | LCK_PW)) + flags |= LDLM_FL_COS_INCOMPAT; req = ldlm_enqueue_pack(osp->opd_exp, 0); if (IS_ERR(req)) @@ -923,13 +925,6 @@ static int osp_md_object_lock(const struct lu_env *env, &flags, NULL, 0, LVB_T_NONE, lh, 0); ptlrpc_req_finished(req); - if (rc == ELDLM_OK) { - struct ldlm_lock *lock; - - lock = __ldlm_handle2lock(lh, 0); - ldlm_set_cbpending(lock); - LDLM_LOCK_PUT(lock); - } return rc == ELDLM_OK ? 0 : -EIO; }