diff options
author | David Howells <dhowells@redhat.com> | 2016-09-04 13:10:10 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-09-04 13:10:10 +0100 |
commit | af338a9ea60acc6337fe9fcdcf664aec2520e541 (patch) | |
tree | 5d7883b1d7cee050b782c540b7cee933adb12dd5 /net/rxrpc/conn_client.c | |
parent | 00b5407e427ac2588a2496b92035a94602b3cd1b (diff) | |
download | linux-af338a9ea60acc6337fe9fcdcf664aec2520e541.tar.bz2 |
rxrpc: The client call state must be changed before attachment to conn
We must set the client call state to RXRPC_CALL_CLIENT_SEND_REQUEST before
attaching the call to the connection struct, not after, as it's liable to
receive errors and conn aborts as soon as the assignment is made - and
these will cause its state to be changed outside of the initiating thread's
control.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/conn_client.c')
-rw-r--r-- | net/rxrpc/conn_client.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index 4b213bc0f554..e19804dd6c8d 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -537,6 +537,10 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn, struct rxrpc_call, chan_wait_link); u32 call_id = chan->call_counter + 1; + write_lock_bh(&call->state_lock); + call->state = RXRPC_CALL_CLIENT_SEND_REQUEST; + write_unlock_bh(&call->state_lock); + rxrpc_see_call(call); list_del_init(&call->chan_wait_link); conn->active_chans |= 1 << channel; |