Commit 84a4c09c authored by David Howells's avatar David Howells

rxrpc: Note a successfully aborted kernel operation

Make rxrpc_kernel_abort_call() return an indication as to whether it
actually aborted the operation or not so that kafs can trace the failure of
the operation.  Note that 'success' in this context means changing the
state of the call, not necessarily successfully transmitting an ABORT
packet.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 3a92789a
...@@ -39,7 +39,7 @@ int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *, ...@@ -39,7 +39,7 @@ int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *,
struct msghdr *, size_t); struct msghdr *, size_t);
int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *, int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *,
void *, size_t, size_t *, bool, u32 *); void *, size_t, size_t *, bool, u32 *);
void rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *, bool rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *,
u32, int, const char *); u32, int, const char *);
void rxrpc_kernel_end_call(struct socket *, struct rxrpc_call *); void rxrpc_kernel_end_call(struct socket *, struct rxrpc_call *);
void rxrpc_kernel_get_peer(struct socket *, struct rxrpc_call *, void rxrpc_kernel_get_peer(struct socket *, struct rxrpc_call *,
......
...@@ -642,20 +642,24 @@ EXPORT_SYMBOL(rxrpc_kernel_send_data); ...@@ -642,20 +642,24 @@ EXPORT_SYMBOL(rxrpc_kernel_send_data);
* @error: Local error value * @error: Local error value
* @why: 3-char string indicating why. * @why: 3-char string indicating why.
* *
* Allow a kernel service to abort a call, if it's still in an abortable state. * Allow a kernel service to abort a call, if it's still in an abortable state
* and return true if the call was aborted, false if it was already complete.
*/ */
void rxrpc_kernel_abort_call(struct socket *sock, struct rxrpc_call *call, bool rxrpc_kernel_abort_call(struct socket *sock, struct rxrpc_call *call,
u32 abort_code, int error, const char *why) u32 abort_code, int error, const char *why)
{ {
bool aborted;
_enter("{%d},%d,%d,%s", call->debug_id, abort_code, error, why); _enter("{%d},%d,%d,%s", call->debug_id, abort_code, error, why);
mutex_lock(&call->user_mutex); mutex_lock(&call->user_mutex);
if (rxrpc_abort_call(why, call, 0, abort_code, error)) aborted = rxrpc_abort_call(why, call, 0, abort_code, error);
if (aborted)
rxrpc_send_abort_packet(call); rxrpc_send_abort_packet(call);
mutex_unlock(&call->user_mutex); mutex_unlock(&call->user_mutex);
_leave(""); return aborted;
} }
EXPORT_SYMBOL(rxrpc_kernel_abort_call); EXPORT_SYMBOL(rxrpc_kernel_abort_call);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment