- lnet_process_id_t peer = req->rq_import->imp_connection->c_peer;
-
- if (rc == -ETIMEDOUT || rc == -EINTR || rc == -ENOTCONN) {
- LASSERT(lock->l_export);
- if (lock->l_export->exp_libclient) {
- LDLM_DEBUG(lock, "%s AST to liblustre client (nid %s)"
- " timeout, just cancelling lock", ast_type,
- libcfs_nid2str(peer.nid));
- ldlm_lock_cancel(lock);
- rc = -ERESTART;
- } else if (ldlm_is_cancel(lock)) {
- LDLM_DEBUG(lock, "%s AST timeout from nid %s, but "
- "cancel was received (AST reply lost?)",
- ast_type, libcfs_nid2str(peer.nid));
- ldlm_lock_cancel(lock);
- rc = -ERESTART;
- } else {
- ldlm_del_waiting_lock(lock);
- 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);
- 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);
- }