summaryrefslogtreecommitdiffstats
path: root/net/rxrpc/call_accept.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-06-27 11:32:03 +0200
committerDavid Howells <dhowells@redhat.com>2016-07-06 11:43:51 +0200
commit2c4579e4b1d5a6219522c6e970500b2fd43fe1f8 (patch)
treec1b3c53567772f18c104213a0296b0860f5157c2 /net/rxrpc/call_accept.c
parentrxrpc: Check that the client conns cache is empty before module removal (diff)
downloadlinux-2c4579e4b1d5a6219522c6e970500b2fd43fe1f8.tar.xz
linux-2c4579e4b1d5a6219522c6e970500b2fd43fe1f8.zip
rxrpc: Move usage count getting into rxrpc_queue_conn()
Rather than calling rxrpc_get_connection() manually before calling rxrpc_queue_conn(), do it inside the queue wrapper. This allows us to do some important fixes: (1) If the usage count is 0, do nothing. This prevents connections from being reanimated once they're dead. (2) If rxrpc_queue_work() fails because the work item is already queued, retract the usage count increment which would otherwise be lost. (3) Don't take a ref on the connection in the work function. By passing the ref through the work item, this is unnecessary. Doing it in the work function is too late anyway. Previously, connection-directed packets held a ref on the connection, but that's not really the best idea. And another useful changes: (*) Don't need to take a refcount on the connection in the data_ready handler unless we invoke the connection's work item. We're using RCU there so that's otherwise redundant. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/call_accept.c')
-rw-r--r--net/rxrpc/call_accept.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c
index 1c0860df150e..5367dbe9b96f 100644
--- a/net/rxrpc/call_accept.c
+++ b/net/rxrpc/call_accept.c
@@ -132,7 +132,6 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local,
_debug("await conn sec");
list_add_tail(&call->accept_link, &rx->secureq);
call->conn->state = RXRPC_CONN_SERVICE_CHALLENGING;
- rxrpc_get_connection(call->conn);
set_bit(RXRPC_CONN_EV_CHALLENGE, &call->conn->events);
rxrpc_queue_conn(call->conn);
} else {