aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/rxrpc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-04-07 12:23:30 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-11 15:34:40 -0400
commitdc44b3a09aec9ac57c1e7410677c87c0e6453624 (patch)
treef1d8e6b201aec9bad334ab6e9df06ccce6bdfd36 /fs/afs/rxrpc.c
parent5b3e87f19e71b7a2f789c40de04704886932b5cf (diff)
rxrpc: Differentiate local and remote abort codes in structs
In the rxrpc_connection and rxrpc_call structs, there's one field to hold the abort code, no matter whether that value was generated locally to be sent or was received from the peer via an abort packet. Split the abort code fields in two for cleanliness sake and add an error field to hold the Linux error number to the rxrpc_call struct too (sometimes this is generated in a context where we can't return it to userspace directly). Furthermore, add a skb mark to indicate a packet that caused a local abort to be generated so that recvmsg() can pick up the correct abort code. A future addition will need to be to indicate to userspace the difference between aborts via a control message. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs/rxrpc.c')
-rw-r--r--fs/afs/rxrpc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index b4d337ad6e36..63cd9f939f19 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -430,9 +430,11 @@ error_kill_call:
430} 430}
431 431
432/* 432/*
433 * handles intercepted messages that were arriving in the socket's Rx queue 433 * Handles intercepted messages that were arriving in the socket's Rx queue.
434 * - called with the socket receive queue lock held to ensure message ordering 434 *
435 * - called with softirqs disabled 435 * Called from the AF_RXRPC call processor in waitqueue process context. For
436 * each call, it is guaranteed this will be called in order of packet to be
437 * delivered.
436 */ 438 */
437static void afs_rx_interceptor(struct sock *sk, unsigned long user_call_ID, 439static void afs_rx_interceptor(struct sock *sk, unsigned long user_call_ID,
438 struct sk_buff *skb) 440 struct sk_buff *skb)
@@ -523,6 +525,12 @@ static void afs_deliver_to_call(struct afs_call *call)
523 call->state = AFS_CALL_ABORTED; 525 call->state = AFS_CALL_ABORTED;
524 _debug("Rcv ABORT %u -> %d", abort_code, call->error); 526 _debug("Rcv ABORT %u -> %d", abort_code, call->error);
525 break; 527 break;
528 case RXRPC_SKB_MARK_LOCAL_ABORT:
529 abort_code = rxrpc_kernel_get_abort_code(skb);
530 call->error = call->type->abort_to_error(abort_code);
531 call->state = AFS_CALL_ABORTED;
532 _debug("Loc ABORT %u -> %d", abort_code, call->error);
533 break;
526 case RXRPC_SKB_MARK_NET_ERROR: 534 case RXRPC_SKB_MARK_NET_ERROR:
527 call->error = -rxrpc_kernel_get_error_number(skb); 535 call->error = -rxrpc_kernel_get_error_number(skb);
528 call->state = AFS_CALL_ERROR; 536 call->state = AFS_CALL_ERROR;