aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-10-19 19:57:57 -0400
committerDavid Howells <dhowells@redhat.com>2018-10-23 19:41:07 -0400
commit4ac15ea53622272c01954461b4814892b7481b40 (patch)
tree3f6d58bfc13699fd7a3c68278e3b6d0f33e12795
parentded2f4c58ac24083c536aa7d2ff2b73752a88612 (diff)
afs: Handle EIO from delivery function
Fix afs_deliver_to_call() to handle -EIO being returned by the operation delivery function, indicating that the call found itself in the wrong state, by printing an error and aborting the call. Currently, an assertion failure will occur. This can happen, say, if the delivery function falls off the end without calling afs_extract_data() with the want_more parameter set to false to collect the end of the Rx phase of a call. The assertion failure looks like: AFS: Assertion failed 4 == 7 is false 0x4 == 0x7 is false ------------[ cut here ]------------ kernel BUG at fs/afs/rxrpc.c:462! and is matched in the trace buffer by a line like: kworker/7:3-3226 [007] ...1 85158.030203: afs_io_error: c=0003be0c r=-5 CM_REPLY Fixes: 98bf40cd99fc ("afs: Protect call->state changes against signals") Reported-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--fs/afs/rxrpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index a3904a8315de..947ae3ab389b 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -499,7 +499,6 @@ static void afs_deliver_to_call(struct afs_call *call)
499 case -EINPROGRESS: 499 case -EINPROGRESS:
500 case -EAGAIN: 500 case -EAGAIN:
501 goto out; 501 goto out;
502 case -EIO:
503 case -ECONNABORTED: 502 case -ECONNABORTED:
504 ASSERTCMP(state, ==, AFS_CALL_COMPLETE); 503 ASSERTCMP(state, ==, AFS_CALL_COMPLETE);
505 goto done; 504 goto done;
@@ -508,6 +507,10 @@ static void afs_deliver_to_call(struct afs_call *call)
508 rxrpc_kernel_abort_call(call->net->socket, call->rxcall, 507 rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
509 abort_code, ret, "KIV"); 508 abort_code, ret, "KIV");
510 goto local_abort; 509 goto local_abort;
510 case -EIO:
511 pr_err("kAFS: Call %u in bad state %u\n",
512 call->debug_id, state);
513 /* Fall through */
511 case -ENODATA: 514 case -ENODATA:
512 case -EBADMSG: 515 case -EBADMSG:
513 case -EMSGSIZE: 516 case -EMSGSIZE: