rxrpc: Queue the call on expiry
authorDavid Howells <dhowells@redhat.com>
Thu, 6 Oct 2016 07:11:50 +0000 (08:11 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 6 Oct 2016 07:11:50 +0000 (08:11 +0100)
When a call expires, it must be queued for the background processor to deal
with otherwise a service call that is improperly terminated will just sit
there awaiting an ACK and won't expire.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/call_event.c

index eeea9602cb896ccd0e5e5219ae9f75809e20f9b8..e2a987fd31cebb0de89688c65d0146cd515ac6b5 100644 (file)
@@ -35,8 +35,11 @@ void rxrpc_set_timer(struct rxrpc_call *call, enum rxrpc_timer_trace why,
 
        if (call->state < RXRPC_CALL_COMPLETE) {
                t = call->expire_at;
-               if (!ktime_after(t, now))
+               if (!ktime_after(t, now)) {
+                       trace_rxrpc_timer(call, why, now, now_j);
+                       queue = true;
                        goto out;
+               }
 
                if (!ktime_after(call->resend_at, now)) {
                        call->resend_at = call->expire_at;
@@ -76,12 +79,11 @@ void rxrpc_set_timer(struct rxrpc_call *call, enum rxrpc_timer_trace why,
                        mod_timer(&call->timer, t_j);
                        trace_rxrpc_timer(call, why, now, now_j);
                }
-
-               if (queue)
-                       rxrpc_queue_call(call);
        }
 
 out:
+       if (queue)
+               rxrpc_queue_call(call);
        read_unlock_bh(&call->state_lock);
 }