Commit fcb871a2 authored by David Howells's avatar David Howells

afs: Fix error code returned from wait

If a client operation for which we're waiting gets interrupted, we need to try
aborting it and then call rxrpc_kernel_recv_data() to find out how the call
actually completed (we could race with an incoming abort, for example).

If we did manage to abort the call, we also need to log the fact that the call
is now complete.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 20181273
...@@ -528,6 +528,7 @@ static void afs_deliver_to_call(struct afs_call *call) ...@@ -528,6 +528,7 @@ static void afs_deliver_to_call(struct afs_call *call)
*/ */
static int afs_wait_for_call_to_complete(struct afs_call *call) static int afs_wait_for_call_to_complete(struct afs_call *call)
{ {
bool aborted;
int ret; int ret;
DECLARE_WAITQUEUE(myself, current); DECLARE_WAITQUEUE(myself, current);
...@@ -558,8 +559,13 @@ static int afs_wait_for_call_to_complete(struct afs_call *call) ...@@ -558,8 +559,13 @@ static int afs_wait_for_call_to_complete(struct afs_call *call)
/* Kill off the call if it's still live. */ /* Kill off the call if it's still live. */
if (call->state < AFS_CALL_COMPLETE) { if (call->state < AFS_CALL_COMPLETE) {
_debug("call interrupted"); _debug("call interrupted");
rxrpc_kernel_abort_call(afs_socket, call->rxcall, aborted = rxrpc_kernel_abort_call(afs_socket, call->rxcall,
RX_USER_ABORT, -EINTR, "KWI"); RX_USER_ABORT, -EINTR, "KWI");
call->error = rxrpc_kernel_recv_data(afs_socket, call->rxcall,
NULL, 0, &call->offset,
false, &call->abort_code);
if (aborted)
trace_afs_call_done(call);
} }
ret = call->error; ret = call->error;
......
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