Commit ae450eb1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] rxrpc update

From: David Howells <dhowells@redhat.com>

Here's a patch to fix some bugs in my RxRPC code, including the fix for the
transport initialisation failure recovery spotted by Pete Zaitcev.

It also inserts some extra spaces in a few places.
parent b6c06e02
......@@ -699,7 +699,7 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call,
timo = rxrpc_call_dfr_ack_timeout + jiffies;
_debug("START ACKR TIMER for cj=%lu", timo-call->cjif);
_debug("START ACKR TIMER for cj=%lu", timo - call->cjif);
spin_lock(&call->lock);
mod_timer(&call->ackr_dfr_timo, timo);
......@@ -722,7 +722,8 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call,
/* fill out the appropriate form */
ack.bufferSpace = htons(RXRPC_CALL_ACK_WINDOW_SIZE);
ack.maxSkew = htons(min(call->ackr_high_seq - seq,65535U));
ack.maxSkew = htons(min(call->ackr_high_seq - seq,
65535U));
ack.firstPacket = htonl(call->ackr_win_bot);
ack.previousPacket = call->ackr_prev_seq;
ack.serial = hdr->serial;
......@@ -825,7 +826,7 @@ void rxrpc_call_do_stuff(struct rxrpc_call *call)
_leave("");
} /* end rxrpc_call_do_timeout() */
} /* end rxrpc_call_do_stuff() */
/*****************************************************************************/
/*
......@@ -1061,7 +1062,7 @@ static void rxrpc_call_receive_data_packet(struct rxrpc_call *call,
_debug("Call add packet %d to unreadyq", msg->seq);
/* insert in seq order */
list_for_each(_p,&call->app_unreadyq) {
list_for_each(_p, &call->app_unreadyq) {
pmsg = list_entry(_p, struct rxrpc_message, link);
if (pmsg->seq > msg->seq)
break;
......@@ -2095,6 +2096,7 @@ int rxrpc_call_flush(struct rxrpc_call *call)
if (msg->hdr.flags & RXRPC_LAST_PACKET) {
msg->hdr.flags &= ~RXRPC_MORE_PACKETS;
if (call->app_call_state != RXRPC_CSTATE_CLNT_SND_ARGS)
msg->hdr.flags |= RXRPC_REQUEST_ACK;
}
else {
......
......@@ -44,12 +44,6 @@ static int rxrpc_krxiod(void *arg)
daemonize("krxiod");
/* only certain signals are of interest */
spin_lock_irq(&current->sighand->siglock);
siginitsetinv(&current->blocked, 0);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
/* loop around waiting for work to do */
do {
/* wait for work or to be told to exit */
......@@ -125,7 +119,7 @@ static int rxrpc_krxiod(void *arg)
* away */
if (atomic_read(&call->usage) > 0) {
_debug("@@@ KRXIOD"
" Begin Attend Call %p",call);
" Begin Attend Call %p", call);
rxrpc_get_call(call);
}
else {
......
......@@ -57,12 +57,6 @@ static int rxrpc_krxsecd(void *arg)
daemonize("krxsecd");
/* only certain signals are of interest */
spin_lock_irq(&current->sighand->siglock);
siginitsetinv(&current->blocked, 0);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
/* loop around waiting for work to do */
do {
/* wait for work or to be told to exit */
......
......@@ -74,12 +74,6 @@ static int krxtimod(void *arg)
complete(&krxtimod_alive);
/* only certain signals are of interest */
spin_lock_irq(&current->sighand->siglock);
siginitsetinv(&current->blocked, 0);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
/* loop around looking for things to attend to */
loop:
set_current_state(TASK_INTERRUPTIBLE);
......
......@@ -130,7 +130,19 @@ int rxrpc_create_transport(unsigned short port,
return 0;
error:
rxrpc_put_transport(trans);
/* finish cleaning up the transport (not really needed here, but...) */
if (trans->socket)
trans->socket->ops->shutdown(trans->socket, 2);
/* close the socket */
if (trans->socket) {
trans->socket->sk->sk_user_data = NULL;
sock_release(trans->socket);
trans->socket = NULL;
}
kfree(trans);
_leave(" = %d", ret);
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment