]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: When activating client conn channels, do state check inside lock
authorDavid Howells <dhowells@redhat.com>
Thu, 29 Sep 2016 21:37:15 +0000 (22:37 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 29 Sep 2016 21:57:47 +0000 (22:57 +0100)
commit21b990897949fce7e95fe467b33ff65e8fb51716
tree0875f34ec86644b5d728006feefdf33c7943cadb
parentd4a9ffebb6635d64ead078a68c5e103492e0400c
rxrpc: When activating client conn channels, do state check inside lock

In rxrpc_activate_channels(), the connection cache state is checked outside
of the lock, which means it can change whilst we're waking calls up,
thereby changing whether or not we're allowed to wake calls up.

Fix this by moving the check inside the locked region.  The check to see if
all the channels are currently busy can stay outside of the locked region.

Whilst we're at it:

 (1) Split the locked section out into its own function so that we can call
     it from other places in a later patch.

 (2) Determine the mask of channels dependent on the state as we're going
     to add another state in a later patch that will restrict the number of
     simultaneous calls to 1 on a connection.

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