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, ...@@ -699,7 +699,7 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call,
timo = rxrpc_call_dfr_ack_timeout + jiffies; 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); spin_lock(&call->lock);
mod_timer(&call->ackr_dfr_timo, timo); mod_timer(&call->ackr_dfr_timo, timo);
...@@ -722,7 +722,8 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call, ...@@ -722,7 +722,8 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call,
/* fill out the appropriate form */ /* fill out the appropriate form */
ack.bufferSpace = htons(RXRPC_CALL_ACK_WINDOW_SIZE); 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.firstPacket = htonl(call->ackr_win_bot);
ack.previousPacket = call->ackr_prev_seq; ack.previousPacket = call->ackr_prev_seq;
ack.serial = hdr->serial; ack.serial = hdr->serial;
...@@ -825,7 +826,7 @@ void rxrpc_call_do_stuff(struct rxrpc_call *call) ...@@ -825,7 +826,7 @@ void rxrpc_call_do_stuff(struct rxrpc_call *call)
_leave(""); _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, ...@@ -1061,7 +1062,7 @@ static void rxrpc_call_receive_data_packet(struct rxrpc_call *call,
_debug("Call add packet %d to unreadyq", msg->seq); _debug("Call add packet %d to unreadyq", msg->seq);
/* insert in seq order */ /* 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); pmsg = list_entry(_p, struct rxrpc_message, link);
if (pmsg->seq > msg->seq) if (pmsg->seq > msg->seq)
break; break;
...@@ -2095,7 +2096,8 @@ int rxrpc_call_flush(struct rxrpc_call *call) ...@@ -2095,7 +2096,8 @@ int rxrpc_call_flush(struct rxrpc_call *call)
if (msg->hdr.flags & RXRPC_LAST_PACKET) { if (msg->hdr.flags & RXRPC_LAST_PACKET) {
msg->hdr.flags &= ~RXRPC_MORE_PACKETS; msg->hdr.flags &= ~RXRPC_MORE_PACKETS;
msg->hdr.flags |= RXRPC_REQUEST_ACK; if (call->app_call_state != RXRPC_CSTATE_CLNT_SND_ARGS)
msg->hdr.flags |= RXRPC_REQUEST_ACK;
} }
else { else {
msg->hdr.flags |= RXRPC_MORE_PACKETS; msg->hdr.flags |= RXRPC_MORE_PACKETS;
......
...@@ -44,12 +44,6 @@ static int rxrpc_krxiod(void *arg) ...@@ -44,12 +44,6 @@ static int rxrpc_krxiod(void *arg)
daemonize("krxiod"); 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 */ /* loop around waiting for work to do */
do { do {
/* wait for work or to be told to exit */ /* wait for work or to be told to exit */
...@@ -116,7 +110,7 @@ static int rxrpc_krxiod(void *arg) ...@@ -116,7 +110,7 @@ static int rxrpc_krxiod(void *arg)
if (!list_empty(&rxrpc_krxiod_callq)) { if (!list_empty(&rxrpc_krxiod_callq)) {
call = list_entry(rxrpc_krxiod_callq.next, call = list_entry(rxrpc_krxiod_callq.next,
struct rxrpc_call, struct rxrpc_call,
rcv_krxiodq_lk); rcv_krxiodq_lk);
list_del_init(&call->rcv_krxiodq_lk); list_del_init(&call->rcv_krxiodq_lk);
atomic_dec(&rxrpc_krxiod_qcount); atomic_dec(&rxrpc_krxiod_qcount);
...@@ -125,7 +119,7 @@ static int rxrpc_krxiod(void *arg) ...@@ -125,7 +119,7 @@ static int rxrpc_krxiod(void *arg)
* away */ * away */
if (atomic_read(&call->usage) > 0) { if (atomic_read(&call->usage) > 0) {
_debug("@@@ KRXIOD" _debug("@@@ KRXIOD"
" Begin Attend Call %p",call); " Begin Attend Call %p", call);
rxrpc_get_call(call); rxrpc_get_call(call);
} }
else { else {
......
...@@ -57,12 +57,6 @@ static int rxrpc_krxsecd(void *arg) ...@@ -57,12 +57,6 @@ static int rxrpc_krxsecd(void *arg)
daemonize("krxsecd"); 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 */ /* loop around waiting for work to do */
do { do {
/* wait for work or to be told to exit */ /* wait for work or to be told to exit */
......
...@@ -74,12 +74,6 @@ static int krxtimod(void *arg) ...@@ -74,12 +74,6 @@ static int krxtimod(void *arg)
complete(&krxtimod_alive); 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 around looking for things to attend to */
loop: loop:
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
......
...@@ -130,7 +130,19 @@ int rxrpc_create_transport(unsigned short port, ...@@ -130,7 +130,19 @@ int rxrpc_create_transport(unsigned short port,
return 0; return 0;
error: 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); _leave(" = %d", ret);
return 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