linux-stable/net/rxrpc
David Howells 2c4579e4b1 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>
2016-07-06 10:43:51 +01:00
..
af_rxrpc.c rxrpc: Check that the client conns cache is empty before module removal 2016-07-06 10:43:51 +01:00
ar-internal.h rxrpc: Move usage count getting into rxrpc_queue_conn() 2016-07-06 10:43:51 +01:00
call_accept.c rxrpc: Move usage count getting into rxrpc_queue_conn() 2016-07-06 10:43:51 +01:00
call_event.c rxrpc: Make rxrpc_send_packet() take a connection not a transport 2016-06-22 09:17:51 +01:00
call_object.c rxrpc: Kill off the rxrpc_transport struct 2016-06-22 14:00:23 +01:00
conn_client.c rxrpc: Check that the client conns cache is empty before module removal 2016-07-06 10:43:51 +01:00
conn_event.c rxrpc: Move usage count getting into rxrpc_queue_conn() 2016-07-06 10:43:51 +01:00
conn_object.c rxrpc: Turn connection #defines into enums and put outside struct def 2016-07-06 10:43:51 +01:00
input.c rxrpc: Move usage count getting into rxrpc_queue_conn() 2016-07-06 10:43:51 +01:00
insecure.c rxrpc: Avoid using stack memory in SG lists in rxkad 2016-07-06 10:43:05 +01:00
Kconfig rxrpc: Absorb the rxkad security module 2016-04-11 15:34:41 -04:00
key.c rxrpc: Use structs to hold connection params and protocol info 2016-06-22 09:09:59 +01:00
local_event.c rxrpc: Rework local endpoint management 2016-06-15 15:38:17 +01:00
local_object.c rxrpc: Kill the client connection bundle concept 2016-06-22 09:20:55 +01:00
Makefile rxrpc: Kill off the rxrpc_transport struct 2016-06-22 14:00:23 +01:00
misc.c rxrpc: Limit the listening backlog 2016-06-10 18:14:47 -07:00
output.c rxrpc: Kill off the rxrpc_transport struct 2016-06-22 14:00:23 +01:00
peer_event.c rxrpc: Use the peer record to distribute network errors 2016-06-15 10:15:16 +01:00
peer_object.c rxrpc: Kill off the rxrpc_transport struct 2016-06-22 14:00:23 +01:00
proc.c rxrpc: Turn connection #defines into enums and put outside struct def 2016-07-06 10:43:51 +01:00
recvmsg.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
rxkad.c rxrpc: Avoid using stack memory in SG lists in rxkad 2016-07-06 10:43:05 +01:00
security.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
skbuff.c rxrpc: Rename files matching ar-*.c to git rid of the "ar-" prefix 2016-06-13 12:16:05 +01:00
sysctl.c rxrpc: Kill off the rxrpc_transport struct 2016-06-22 14:00:23 +01:00
utils.c rxrpc: Rework peer object handling to use hash table and RCU 2016-06-15 10:12:33 +01:00