Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5038158pxb; Mon, 15 Feb 2021 07:59:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDgfSAMLfgWNyX8sjL51gZolG1DWFrmvCj4S8uT8+Hre0DW6iiUytpcbgTjze894zjJgdi X-Received: by 2002:a05:6402:1ac2:: with SMTP id ba2mr15968509edb.81.1613404796435; Mon, 15 Feb 2021 07:59:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613404796; cv=none; d=google.com; s=arc-20160816; b=mXtfKNdJl+EqpYeLWgR0D5Ic28GoYSjq1O8dL/g90s6zYY+DmujjZ/7UMWs8n0x8Z/ z8CXueKZ6ui8Hgb+015V4x31T/63P+GM6ILEq2vUxPsAU+hX3togy3/tmNYvXpIZTNgf 5z0iiqxoQXnvxrQKtjykl+MBD31nAh4PcriOg3FxDGSxZ1WPFc3dR3Q5vdJ8JMP79aQx Hy6pyt5Ggnf2zaqV7hEKzefWRX1KXjdGURxrqTHDOz+5pFZVKG6KVFWa9CQFqb11vnzR 4PoK5A1Gu4oEcjxdTiNlirL1i+ytowM6kZRLk++SXLfaF66PAdrA99Cinz5+Mz/EMOSR fa8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:dkim-signature; bh=3yIkakUHyeHN1MlQyHWPGMFQp6J7MPF7/vE2qQQMyPM=; b=K7GH/oTNQ6D+H1qGM5FvO6E+d/IxZUd7twHDPN4PbC+04aUTWG1Mm1UjjxquBoifQC xuKmi4Y/n98khpQeYZkwKVDZNd7rtvxL6tunCuETuLd+a8p4a0YgG1lktqep3isFhTmS iG3MfmOpEcsQD10UxPf4AAh9yfu9RS+5Z7ePhVbBQPQC8Fda+CPIx/vqzPu7uvZTsTj3 guztXEujlUOOfyDOZm6Xjhd7NwbJIu1x8SQ4Y134yel9+mTFuJc4bikT46LNXq2xJf0K 1SQAy9Cxf99dJ8Sdx8Z3kUfLG+1Gv4fat5yAjrmQpVvZhEE4fPdHBkNO51AG/NZLyzgD YZyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jKbg0ljk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de28si11845028edb.466.2021.02.15.07.59.33; Mon, 15 Feb 2021 07:59:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jKbg0ljk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbhBOP5l (ORCPT + 99 others); Mon, 15 Feb 2021 10:57:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24785 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbhBOPtt (ORCPT ); Mon, 15 Feb 2021 10:49:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613404102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3yIkakUHyeHN1MlQyHWPGMFQp6J7MPF7/vE2qQQMyPM=; b=jKbg0ljkQa4lQXqmYjwzddHq5wogj2pIn++ZUHr/Y6uF7+R2A+xJSbZ9HNgop0Hv2U+wyg wp9wjJ4SUhv3iAnNwmXgvupzLkCBPsx25/8I6q1Hr6fb6lUYjTkE1Kk5NY1XgnYEr3rFOz bOIpEikgfL4JE/+do4sjRNIqylAiPMY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-gwxFTs72N2WJz0GoBc-DLQ-1; Mon, 15 Feb 2021 10:48:21 -0500 X-MC-Unique: gwxFTs72N2WJz0GoBc-DLQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B724107ACE3; Mon, 15 Feb 2021 15:48:18 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-119-68.rdu2.redhat.com [10.10.119.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D6385D9CD; Mon, 15 Feb 2021 15:48:11 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 20/33] afs: Log remote unmarshalling errors From: David Howells To: Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet Cc: linux-afs@lists.infradead.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, dhowells@redhat.com, Jeff Layton , David Wysochanski , "Matthew Wilcox (Oracle)" , Alexander Viro , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 15 Feb 2021 15:48:11 +0000 Message-ID: <161340409118.1303470.17812607349396199116.stgit@warthog.procyon.org.uk> In-Reply-To: <161340385320.1303470.2392622971006879777.stgit@warthog.procyon.org.uk> References: <161340385320.1303470.2392622971006879777.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Log unmarshalling errors reported by the peer (ie. it can't parse what we sent it). Limit the maximum number of messages to 3. Signed-off-by: David Howells cc: linux-afs@lists.infradead.org cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org --- fs/afs/rxrpc.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 0ec38b758f29..ae68576f822f 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -500,6 +500,39 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) _leave(" = %d", ret); } +/* + * Log remote abort codes that indicate that we have a protocol disagreement + * with the server. + */ +static void afs_log_error(struct afs_call *call, s32 remote_abort) +{ + static int max = 0; + const char *msg; + int m; + + switch (remote_abort) { + case RX_EOF: msg = "unexpected EOF"; break; + case RXGEN_CC_MARSHAL: msg = "client marshalling"; break; + case RXGEN_CC_UNMARSHAL: msg = "client unmarshalling"; break; + case RXGEN_SS_MARSHAL: msg = "server marshalling"; break; + case RXGEN_SS_UNMARSHAL: msg = "server unmarshalling"; break; + case RXGEN_DECODE: msg = "opcode decode"; break; + case RXGEN_SS_XDRFREE: msg = "server XDR cleanup"; break; + case RXGEN_CC_XDRFREE: msg = "client XDR cleanup"; break; + case -32: msg = "insufficient data"; break; + default: + return; + } + + m = max; + if (m < 3) { + max = m + 1; + pr_notice("kAFS: Peer reported %s failure on %s [%pISp]\n", + msg, call->type->name, + &call->alist->addrs[call->addr_ix].transport); + } +} + /* * deliver messages to a call */ @@ -563,6 +596,7 @@ static void afs_deliver_to_call(struct afs_call *call) goto out; case -ECONNABORTED: ASSERTCMP(state, ==, AFS_CALL_COMPLETE); + afs_log_error(call, call->abort_code); goto done; case -ENOTSUPP: abort_code = RXGEN_OPCODE;