Update lvbo from disk when AST fails with EINVAL.
i=vitaly.fertman
i=andrew.perepechko
ldlm_failed_ast(lock, rc, ast_type);
}
} else if (rc) {
ldlm_failed_ast(lock, rc, ast_type);
}
} else if (rc) {
+ if (rc == -EINVAL) {
+ struct ldlm_resource *res = lock->l_resource;
LDLM_DEBUG(lock, "client (nid %s) returned %d"
" from %s AST - normal race",
libcfs_nid2str(peer.nid),
req->rq_repmsg ?
lustre_msg_get_status(req->rq_repmsg) : -1,
ast_type);
LDLM_DEBUG(lock, "client (nid %s) returned %d"
" from %s AST - normal race",
libcfs_nid2str(peer.nid),
req->rq_repmsg ?
lustre_msg_get_status(req->rq_repmsg) : -1,
ast_type);
+ if (res) {
+ /* update lvbo to return proper attributes.
+ * see bug 23174 */
+ ldlm_resource_getref(res);
+ ldlm_res_lvbo_update(res, NULL, 1);
+ ldlm_resource_putref(res);
+ }
+
+ } else {
LDLM_ERROR(lock, "client (nid %s) returned %d "
"from %s AST", libcfs_nid2str(peer.nid),
(req->rq_repmsg != NULL) ?
lustre_msg_get_status(req->rq_repmsg) : 0,
ast_type);
LDLM_ERROR(lock, "client (nid %s) returned %d "
"from %s AST", libcfs_nid2str(peer.nid),
(req->rq_repmsg != NULL) ?
lustre_msg_get_status(req->rq_repmsg) : 0,
ast_type);
ldlm_lock_cancel(lock);
/* Server-side AST functions are called from ldlm_reprocess_all,
* which needs to be told to please restart its reprocessing. */
ldlm_lock_cancel(lock);
/* Server-side AST functions are called from ldlm_reprocess_all,
* which needs to be told to please restart its reprocessing. */
lock = req->rq_async_args.pointer_arg[1];
LASSERT(lock != NULL);
if (rc != 0) {
lock = req->rq_async_args.pointer_arg[1];
LASSERT(lock != NULL);
if (rc != 0) {
- /* If client canceled the lock but the cancel has not
- * been received yet, we need to update lvbo to have the
- * proper attributes cached. */
- if (rc == -EINVAL && arg->type == LDLM_BL_CALLBACK)
- ldlm_res_lvbo_update(lock->l_resource, NULL, 1);
rc = ldlm_handle_ast_error(lock, req, rc,
arg->type == LDLM_BL_CALLBACK
? "blocking" : "completion");
rc = ldlm_handle_ast_error(lock, req, rc,
arg->type == LDLM_BL_CALLBACK
? "blocking" : "completion");
LASSERTF(l->l_glimpse_ast != NULL, "l == %p", l);
rc = l->l_glimpse_ast(l, NULL); /* this will update the LVB */
LASSERTF(l->l_glimpse_ast != NULL, "l == %p", l);
rc = l->l_glimpse_ast(l, NULL); /* this will update the LVB */
- /* Update the LVB from disk if the AST failed (this is a legal race) */
- /*
- * XXX nikita: situation when ldlm_server_glimpse_ast() failed before
- * sending ast is not handled. This can result in lost client writes.
- */
- if (rc != 0)
- ldlm_res_lvbo_update(res, NULL, 1);
lock_res(res);
*reply_lvb = *res_lvb;
lock_res(res);
*reply_lvb = *res_lvb;