http://bugzilla.openvz.org/show_bug.cgi?id=166 http://forum.openvz.org/index.php?t=tree&th=533&mid=3089&&rev=&reveal= --- ./net/rxrpc/connection.c.afs 2004-08-14 14:55:34.000000000 +0400 +++ ./net/rxrpc/connection.c 2006-05-12 11:57:43.000000000 +0400 @@ -621,6 +621,7 @@ int rxrpc_conn_sendmsg(struct rxrpc_conn { struct msghdr msghdr; int ret; + struct ve_struct *ve; _enter("%p{%d}", conn, ntohs(conn->addr.sin_port)); @@ -643,9 +644,11 @@ int rxrpc_conn_sendmsg(struct rxrpc_conn htonl(conn->addr.sin_addr.s_addr), htons(conn->addr.sin_port)); + ve = set_exec_env(get_ve0()); /* send the message */ ret = kernel_sendmsg(conn->trans->socket, &msghdr, msg->data, msg->dcount, msg->dsize); + (void)set_exec_env(ve); if (ret < 0) { msg->state = RXRPC_MSG_ERROR; } else { --- ./net/rxrpc/transport.c.afs 2004-08-14 14:55:48.000000000 +0400 +++ ./net/rxrpc/transport.c 2006-05-12 12:03:35.000000000 +0400 @@ -59,6 +59,7 @@ static void rxrpc_trans_receive_error_re int rxrpc_create_transport(unsigned short port, struct rxrpc_transport **_trans) { + struct ve_struct *ve; struct rxrpc_transport *trans; struct sockaddr_in sin; mm_segment_t oldfs; @@ -85,6 +86,7 @@ int rxrpc_create_transport(unsigned shor atomic_set(&trans->peer_count, 0); trans->port = port; + ve = set_exec_env(get_ve0()); /* create a UDP socket to be my actual transport endpoint */ ret = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &trans->socket); if (ret < 0) @@ -108,6 +110,7 @@ int rxrpc_create_transport(unsigned shor ret = trans->socket->ops->setsockopt(trans->socket, SOL_IP, IP_RECVERR, (char *) &opt, sizeof(opt)); set_fs(oldfs); + (void)set_exec_env(ve); spin_lock(&rxrpc_transports_lock); list_add(&trans->link, &rxrpc_transports); @@ -141,6 +144,7 @@ int rxrpc_create_transport(unsigned shor trans->socket = NULL; } + (void)set_exec_env(ve); kfree(trans); @@ -164,6 +168,7 @@ void rxrpc_clear_transport(struct rxrpc_ */ void rxrpc_put_transport(struct rxrpc_transport *trans) { + struct ve_struct *ve; _enter("%p{u=%d p=%hu}", trans, atomic_read(&trans->usage), trans->port); @@ -182,6 +187,7 @@ void rxrpc_put_transport(struct rxrpc_tr spin_unlock(&rxrpc_transports_lock); /* finish cleaning up the transport */ + ve = set_exec_env(get_ve0()); if (trans->socket) trans->socket->ops->shutdown(trans->socket, 2); @@ -203,6 +209,7 @@ void rxrpc_put_transport(struct rxrpc_tr trans->socket = NULL; } + (void)set_exec_env(ve); kfree(trans); _leave(""); @@ -608,6 +615,7 @@ int rxrpc_trans_immediate_abort(struct r struct rxrpc_message *msg, int error) { + struct ve_struct *ve; struct rxrpc_header ahdr; struct sockaddr_in sin; struct msghdr msghdr; @@ -659,7 +667,9 @@ int rxrpc_trans_immediate_abort(struct r htons(sin.sin_port)); /* send the message */ + ve = set_exec_env(get_ve0()); ret = kernel_sendmsg(trans->socket, &msghdr, iov, 2, len); + (void)set_exec_env(ve); _leave(" = %d", ret); return ret; @@ -672,6 +682,7 @@ int rxrpc_trans_immediate_abort(struct r */ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans) { + struct ve_struct *ve; struct rxrpc_connection *conn; struct sockaddr_in sin; struct rxrpc_peer *peer; @@ -693,8 +704,10 @@ static void rxrpc_trans_receive_error_re msg.msg_controllen = sizeof(emsg); msg.msg_flags = 0; + ve = set_exec_env(get_ve0()); err = kernel_recvmsg(trans->socket, &msg, NULL, 0, 0, MSG_ERRQUEUE | MSG_DONTWAIT | MSG_TRUNC); + (void)set_exec_env(ve); if (err == -EAGAIN) { _leave("");