diff options
author | David Howells <dhowells@redhat.com> | 2019-04-12 11:34:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-12 19:57:23 -0400 |
commit | 39ce67557568962fa9d1593741f76c4cc6762469 (patch) | |
tree | 8c061a85e4be4a6722875de7b0d72f497385e3f9 /net/rxrpc | |
parent | f7f1dd3162efc7ffdbcdb9da1ad1599f8ab51296 (diff) |
rxrpc: Trace received connection aborts
Trace received calls that are aborted due to a connection abort, typically
because of authentication failure. Without this, connection aborts don't
show up in the trace log.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/conn_event.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c index b6fca8ebb117..8d31fb4c51e1 100644 --- a/net/rxrpc/conn_event.c +++ b/net/rxrpc/conn_event.c | |||
@@ -153,7 +153,8 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn, | |||
153 | * pass a connection-level abort onto all calls on that connection | 153 | * pass a connection-level abort onto all calls on that connection |
154 | */ | 154 | */ |
155 | static void rxrpc_abort_calls(struct rxrpc_connection *conn, | 155 | static void rxrpc_abort_calls(struct rxrpc_connection *conn, |
156 | enum rxrpc_call_completion compl) | 156 | enum rxrpc_call_completion compl, |
157 | rxrpc_serial_t serial) | ||
157 | { | 158 | { |
158 | struct rxrpc_call *call; | 159 | struct rxrpc_call *call; |
159 | int i; | 160 | int i; |
@@ -173,6 +174,9 @@ static void rxrpc_abort_calls(struct rxrpc_connection *conn, | |||
173 | call->call_id, 0, | 174 | call->call_id, 0, |
174 | conn->abort_code, | 175 | conn->abort_code, |
175 | conn->error); | 176 | conn->error); |
177 | else | ||
178 | trace_rxrpc_rx_abort(call, serial, | ||
179 | conn->abort_code); | ||
176 | if (rxrpc_set_call_completion(call, compl, | 180 | if (rxrpc_set_call_completion(call, compl, |
177 | conn->abort_code, | 181 | conn->abort_code, |
178 | conn->error)) | 182 | conn->error)) |
@@ -213,8 +217,6 @@ static int rxrpc_abort_connection(struct rxrpc_connection *conn, | |||
213 | conn->state = RXRPC_CONN_LOCALLY_ABORTED; | 217 | conn->state = RXRPC_CONN_LOCALLY_ABORTED; |
214 | spin_unlock_bh(&conn->state_lock); | 218 | spin_unlock_bh(&conn->state_lock); |
215 | 219 | ||
216 | rxrpc_abort_calls(conn, RXRPC_CALL_LOCALLY_ABORTED); | ||
217 | |||
218 | msg.msg_name = &conn->params.peer->srx.transport; | 220 | msg.msg_name = &conn->params.peer->srx.transport; |
219 | msg.msg_namelen = conn->params.peer->srx.transport_len; | 221 | msg.msg_namelen = conn->params.peer->srx.transport_len; |
220 | msg.msg_control = NULL; | 222 | msg.msg_control = NULL; |
@@ -242,6 +244,7 @@ static int rxrpc_abort_connection(struct rxrpc_connection *conn, | |||
242 | len = iov[0].iov_len + iov[1].iov_len; | 244 | len = iov[0].iov_len + iov[1].iov_len; |
243 | 245 | ||
244 | serial = atomic_inc_return(&conn->serial); | 246 | serial = atomic_inc_return(&conn->serial); |
247 | rxrpc_abort_calls(conn, RXRPC_CALL_LOCALLY_ABORTED, serial); | ||
245 | whdr.serial = htonl(serial); | 248 | whdr.serial = htonl(serial); |
246 | _proto("Tx CONN ABORT %%%u { %d }", serial, conn->abort_code); | 249 | _proto("Tx CONN ABORT %%%u { %d }", serial, conn->abort_code); |
247 | 250 | ||
@@ -321,7 +324,7 @@ static int rxrpc_process_event(struct rxrpc_connection *conn, | |||
321 | conn->error = -ECONNABORTED; | 324 | conn->error = -ECONNABORTED; |
322 | conn->abort_code = abort_code; | 325 | conn->abort_code = abort_code; |
323 | conn->state = RXRPC_CONN_REMOTELY_ABORTED; | 326 | conn->state = RXRPC_CONN_REMOTELY_ABORTED; |
324 | rxrpc_abort_calls(conn, RXRPC_CALL_REMOTELY_ABORTED); | 327 | rxrpc_abort_calls(conn, RXRPC_CALL_REMOTELY_ABORTED, sp->hdr.serial); |
325 | return -ECONNABORTED; | 328 | return -ECONNABORTED; |
326 | 329 | ||
327 | case RXRPC_PACKET_TYPE_CHALLENGE: | 330 | case RXRPC_PACKET_TYPE_CHALLENGE: |