Skip to content

Commit 0509275

Browse files
committed
1 parent f105da1 commit 0509275

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

fs/afs/rxrpc.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,39 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
500500
_leave(" = %d", ret);
501501
}
502502

503+
/*
504+
* Log remote abort codes that indicate that we have a protocol disagreement
505+
* with the server.
506+
*/
507+
static void afs_log_error(struct afs_call *call, s32 remote_abort)
508+
{
509+
static int max = 0;
510+
const char *msg;
511+
int m;
512+
513+
switch (remote_abort) {
514+
case RX_EOF: msg = "unexpected EOF"; break;
515+
case RXGEN_CC_MARSHAL: msg = "client marshalling"; break;
516+
case RXGEN_CC_UNMARSHAL: msg = "client unmarshalling"; break;
517+
case RXGEN_SS_MARSHAL: msg = "server marshalling"; break;
518+
case RXGEN_SS_UNMARSHAL: msg = "server unmarshalling"; break;
519+
case RXGEN_DECODE: msg = "opcode decode"; break;
520+
case RXGEN_SS_XDRFREE: msg = "server XDR cleanup"; break;
521+
case RXGEN_CC_XDRFREE: msg = "client XDR cleanup"; break;
522+
case -32: msg = "insufficient data"; break;
523+
default:
524+
return;
525+
}
526+
527+
m = max;
528+
if (m < 3) {
529+
max = m + 1;
530+
pr_notice("kAFS: Peer reported %s failure on %s [%pISp]\n",
531+
msg, call->type->name,
532+
&call->alist->addrs[call->addr_ix].transport);
533+
}
534+
}
535+
503536
/*
504537
* deliver messages to a call
505538
*/
@@ -563,6 +596,7 @@ static void afs_deliver_to_call(struct afs_call *call)
563596
goto out;
564597
case -ECONNABORTED:
565598
ASSERTCMP(state, ==, AFS_CALL_COMPLETE);
599+
afs_log_error(call, call->abort_code);
566600
goto done;
567601
case -ENOTSUPP:
568602
abort_code = RXGEN_OPCODE;

0 commit comments

Comments
 (0)