Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3483327pxf; Mon, 22 Mar 2021 07:29:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5IKyw7PDAqofP02fxyTyLUqrlrc9puwnkq8/a2PBgi7K7Sb0zwzoXsUx7Sz/8yPE9ks1o X-Received: by 2002:a05:6402:51d4:: with SMTP id r20mr25945465edd.112.1616423396679; Mon, 22 Mar 2021 07:29:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616423396; cv=pass; d=google.com; s=arc-20160816; b=aY3fR6Mt+LJ072jHHQIrf9XjJfB6LWpWUMBbJcgX5jfgIzGwWm3jsafIq9EzTh4QeM hkgFOk7lFL+GCGDRKwh+09FXYy3+lI1acXEH0IZHF8aVQWylLRFyPoSRZlWBQD8ZcDgY P90w/AJbQTG+P7lweZI9TY8RGmRvVhMpT/WtrNHiLmuNN9cUCDL/YcirwfpPsQRJNfuF kw6sm1pGdvXZ7oKqJ8/SXmHZ48CBuFXlRVVUfY3S8RC5lEWokkDVuDk1Rr7wK4EosbY5 xM/ft1E/b0YquBgpwGPncBY+uw9Yb7l48tNZOlgmL1I9N35fJjlGIjLpWIWG8ul9UlZn KW2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=PjE0JOc6XCVuVPh36oWmoAoJM65fBUwMKXsQfMVqCpE=; b=DSyt3kiNYjLN87UDI2jp5UHtnoSsQ8Upj3BlNEXBKslBoiQeVnjZEgLtwYNW+DXbZt NCOTp1Tdfx7yvD9rXkOdzQhtGURyB7PquAD6IZLtbkwwjUyHy565HRzZpa94tNDkOdjd QloSMrCPkldotHFaa2RyD39IZISlBlsmhK7DF+dF/RvK21WLWMa46G1e6dw4W+ygw4Hm A3qyYxRfX5IXGxV9tBhl0L/fhW1PbD5P16IR4aPorNqEpCsYQJJDgQqUWKvMFYY9Dmii lMjXJWihnETiiuNQ9sbsLfS9gADQYoFu2jJreSlRoPdq4kqQy0JH3OpwprRwQm5U5R+9 v9uQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=t87elVXT; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=r45S85cc; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si10915595edu.536.2021.03.22.07.29.32; Mon, 22 Mar 2021 07:29:56 -0700 (PDT) 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=@oracle.com header.s=corp-2020-01-29 header.b=t87elVXT; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=r45S85cc; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbhCVO3A (ORCPT + 99 others); Mon, 22 Mar 2021 10:29:00 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38174 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbhCVO2o (ORCPT ); Mon, 22 Mar 2021 10:28:44 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12MENtUX164783; Mon, 22 Mar 2021 14:28:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=PjE0JOc6XCVuVPh36oWmoAoJM65fBUwMKXsQfMVqCpE=; b=t87elVXT7hGhGQhYSAjiJVYelJP0g6lrBznazSMy7OkkZnABqi0e0Lo5DkOgoW2xOlKP I58v+w4CRplDnIONcqyAbr5kq5ifJCs8NV9ZH6JCWnGOoLS16gYf5VhhQlqG868G8W7D QEhgNiUBvQ/Itgk6PZv0ryC9dKEl9kxPc9rNdzPZjvbWNWzVFRfx1xZWEScTrXWKojAM qslnVvIb8IBnykTdtiNo3Uz+t0PiPUYv/3P0zHgckis/zl8nHNs33UU56H6gXRROEL6R tuTgZk2aobmYcccy5YGqabBl13p2ywZ+uS82KQU7EmXKfbILnzrKpCiD9Y3EhLCLYmQj zA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 37d9pmum3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Mar 2021 14:28:32 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12MEP50m081145; Mon, 22 Mar 2021 14:28:32 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2044.outbound.protection.outlook.com [104.47.73.44]) by aserp3030.oracle.com with ESMTP id 37dtmn97jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Mar 2021 14:28:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fX7XK5sCSKaSWl15aYnoCtgoNvdTMAVd2dNah3MsEY7YE5JLCCWJkO1BMLY0QiAaIjlI9z7z0WsdubHyskjaXcv/L65bFqTUpUmaPs44kdx3dMkTIGEvfg+HBtxllMueDyU8JszAZ59slWocNAhFRFt/5hJrXQSIk8ggcroVrcGvK2U3vVrChCTARm+ryOkWAuNecGv7LI5WoHKw1FcqJcyPJeokeAPHmO/scHH7sPqrdUs8bg8BhBxbabI8Mz0/KvH8ODeSUApOZicu9CQsmg88vZdRD4oopMa7MGLdC3mGSNMC15cjOi/urS/OdF+0vLDu3G+vQMc3ADgrpP2ykQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PjE0JOc6XCVuVPh36oWmoAoJM65fBUwMKXsQfMVqCpE=; b=hyQt/y4QX8q/Z21OJtkW6UeF3fDEPuu0B6f6vXBfdT8FTxkdUoXdJMrSgOfAylJuEl6pMMPfvAEP8Y+7eQIxeTCRA0sYcIG48Czp81wHa9eFoFNX6hrTY0guCCP+5NQYjTrY4312TdXD+NQ+xo3np+YHsa9xcWma/Ed1eBf1ylD+gsYuCsBDpwRFt95zBdvqBCYr+806lkCbu7EMqR5Lg192QJEs9AN6NrENeG5f6BBMNTB5nD1L0Ksd50Vi4K1iObMnkHNYDVgpoMTLdAEquq2lIwL3JiMTf+pdYUGHHg1tJwkro2blWhxG9dfr5F0Q/Ipf0h4fCgFI6b5t9YjR1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PjE0JOc6XCVuVPh36oWmoAoJM65fBUwMKXsQfMVqCpE=; b=r45S85ccfY/diqIuzJ6E7Udkf6phg+wi3bZhYEVReQzV0gPDoCMBK3NPzSanzVh1jlB5Se35bM9v6wsyX1v1HVVCnOYqvFM2nI+/Dxn4hUnxr3ou/i1nShxg+bXYfSzbq7t7JI3kDOdbM619zwk4D0StekZLRKsR3C57x+iMPNI= Received: from SJ0PR10MB4688.namprd10.prod.outlook.com (2603:10b6:a03:2db::24) by BY5PR10MB3857.namprd10.prod.outlook.com (2603:10b6:a03:1b0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.23; Mon, 22 Mar 2021 14:28:29 +0000 Received: from SJ0PR10MB4688.namprd10.prod.outlook.com ([fe80::50bf:7319:321c:96c9]) by SJ0PR10MB4688.namprd10.prod.outlook.com ([fe80::50bf:7319:321c:96c9%4]) with mapi id 15.20.3955.027; Mon, 22 Mar 2021 14:28:29 +0000 From: Chuck Lever III To: Bruce Fields , Chris Down CC: Linux NFS Mailing List , Linux-Net , LKML , Trond Myklebust , "David S. Miller" Subject: Re: [PATCH] SUNRPC: Output oversized frag reclen as ASCII if printable Thread-Topic: [PATCH] SUNRPC: Output oversized frag reclen as ASCII if printable Thread-Index: AQHXHM/NVCtugqioaUyypXdJqaYWcqqLZvMAgAB4GYCABDaVgA== Date: Mon, 22 Mar 2021 14:28:29 +0000 Message-ID: <117735A5-0545-451E-AFD8-28440F7E2DBE@oracle.com> References: <3844BF67-8820-4D6C-95BA-8BA0B0956BD0@oracle.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; x-originating-ip: [68.61.232.219] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 62578d2a-a1ef-410a-7405-08d8ed3ec35c x-ms-traffictypediagnostic: BY5PR10MB3857: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1751; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UgBXaXPp58Eu31zof60/u/uo/C/1yXgevCIOLEV3Q8aDfP0g658KH6YsEV8Q2HNVVXY2nVaZ0SRYFId5i3WhBCqTEAYgs4gtyKcOisJymPSZ/xAezfIpfL/ySH+ClN5Zcnitu1s2G+06wTnOiFxWZMiLFTO7DYWpyL2eBhpL0I5YtJSQda0KicDQzQBtpt4DF5+ZcFWz7XjxPAfEtf7+LXl8faVO7/NJrcVvqngx9C/MVwh1vmv096VNtcsVTrT/qPwdrHAzTSZzmsQfTwIOMRoh3aUVFkBX1WgSPt8HGRz3NeuSbibDIfbLg8yIkptfG+S+zM9unT2DDjTQJxKehpAiXOGAdhZ29ZKMetcraE5IOA8siRZVJiabPpzoLccnki1+7sy6PhiQBowv4xN7J2dAu61pWzibu+B+J+339v4syUh+WLbcr+3mBH/TDz3MNfokZ8DPKr5KJrSQrmnDU/PEYZKst2CykQsLwjEKb6xFDYtf4gv8T72daJB8GWGbBJVWQJAtCg9/QRxVbgZrOHgoz+yHKNTeevwL89w/vx9LFxR3CAyyhFCB6LlMPplPCViJn9lnhGtsbqDDFzEaINO35fdtGsWkvFSstYhZOQ8xt9QWFwCHJ4/pQIm1TQeIFU/9bKmpncFmjubiuCBfFdXA5yyRJzeQxPMCnHKArkMOZUXW6nwRQz+JYODI2mgD x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4688.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(346002)(39860400002)(396003)(366004)(376002)(6486002)(6506007)(26005)(83380400001)(86362001)(38100700001)(53546011)(66946007)(64756008)(66446008)(76116006)(316002)(91956017)(110136005)(54906003)(4326008)(478600001)(5660300002)(8676002)(66476007)(8936002)(6512007)(2616005)(186003)(2906002)(71200400001)(33656002)(36756003)(66556008)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?ZZTV742kmlSoAOJ6yIrfpfTjKPHCSzJNLhap8/cmkN3m+l7r91X6kFT5npq9?= =?us-ascii?Q?vtM33up4PDZ/WRVX39Syaew3QQksVxcQDMc8M4G3m5PcNki0n7+tB/BEuPE5?= =?us-ascii?Q?WoYMoaSVQDNieHX4OpQEK4FkOiK2AyzHp4jAkDeVn4Nl3MEAuJeB7+YVa/Jy?= =?us-ascii?Q?BQzODc39ZDGyT1P7SjSrxbzr/CIUVBKbMbjpmvZPwiH2y7XGF41wBq9PUblM?= =?us-ascii?Q?qaF0nemOOu3/macc8uvTmpzwkUICd9WukELdQUTcZqWGkdEsVk0Eaxk1nZx2?= =?us-ascii?Q?x7xZoONf+4CWBNnN9oNmk86LcaBC6KbWJZG8hJrqlbOnInRp91P64AuNurrN?= =?us-ascii?Q?sHYREQYJeM3rS8JMMCnFv5iK1eR01M87b6lnIzVtibUISX10avbfayvyjbEe?= =?us-ascii?Q?lyWRfyNsiciVIKF0BD5AleZcTn0zeFemGlVslS4s9abiNG0mzMrroV+se2xW?= =?us-ascii?Q?YyMrOj+G89riVngrxvRo94NyLwFgcIwDK/ecZCYPYE5TUjEsF4X5u6EtXdCB?= =?us-ascii?Q?M751ML4htYk6VrY55HIF9wc+sP4h/MAYt6f30ar2iZaF3uKr/HzvYql6xx4X?= =?us-ascii?Q?cDyhVl5zjYRIkyeil5NYqdu/y6b65K36SMSIjokqc9LAzVQtM5Zn7EBgklcY?= =?us-ascii?Q?a7O5EO/53T1ME7gYVFlkbWico1/+uLe0F87nzPyOBKr2FFOJQV9/vgyqASDk?= =?us-ascii?Q?usPcGx5WeZY6uIjT2Z1Ozf2WHPVUWQdFQv6VH6fqK1f+duMwrLJ4n1Fn9hac?= =?us-ascii?Q?lyoET0qS1ocWpGdEDo01Htej1/GNNaolkB2gQbQzM5w53IRdtIqPNkuX/7E0?= =?us-ascii?Q?9Z0hPH2vYxykemYb/7HfmgxzObhHA5cax5Lw10Zd1VSFQmkbhmrSmpb78R5J?= =?us-ascii?Q?D9xDWfGXHnE+Lmg7gok/x4PMkDBqiIRnUwvVpfTQ9otmHc1f7ZSMEVT4FTeV?= =?us-ascii?Q?JO7pCGu81S08XQ3jAJmMra2I7VUrqkwQQJdbDObYngujSSp+cyRRhcujhLMr?= =?us-ascii?Q?dzO30al9YZ1MYjDPOLXgSM82LBEEBr2BJyhnGdUGJ4bQKs1W+4MfJHrZxMyM?= =?us-ascii?Q?LsBKMhmdoXgQjjD+M+q/fivxZOJOWlhA7/gHplWDGNeXZaZzNcuLr6aZgrNd?= =?us-ascii?Q?pLAh02jSQdwTeoIXjdhOQFiqQnT0mjWxVzrQKqZUhGm6LgG1WZzw+iCKguLE?= =?us-ascii?Q?qmzA8iDQEnUBY9t1t0hAPILXlh2whYRt2gtSWTxXlosnBDIQE4PGPvSQuVM6?= =?us-ascii?Q?AUWUbd8UtmzfwxQ0tSafbGggBG/ebhd5XFT3NwQVTbSPk155d/TuoDSnXNZY?= =?us-ascii?Q?l/njAK1mogKSb6qmc2UjvX89?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4688.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62578d2a-a1ef-410a-7405-08d8ed3ec35c X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2021 14:28:29.3619 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kY2btQ7TmU62+iP+SSafJBD0dcb2Rl10E12qfLixMlWW+fPE1TyHgI3dSgUHYJm0ZOiL2chK4XFNKzPRgIj2Yg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3857 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9931 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103220106 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9931 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103220106 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > On Mar 19, 2021, at 6:08 PM, J. Bruce Fields wrote: >=20 > On Fri, Mar 19, 2021 at 02:58:14PM +0000, Chuck Lever III wrote: >> Hi Chris- >>=20 >>> On Mar 19, 2021, at 10:54 AM, Chris Down wrote: >>>=20 >>> The reclen is taken directly from the first four bytes of the message >>> with the highest bit stripped, which makes it ripe for protocol mixups. >>> For example, if someone tries to send a HTTP GET request to us, we'll >>> interpret it as a 1195725856-sized fragment (ie. (u32)'GET '), and prin= t >>> a ratelimited KERN_NOTICE with that number verbatim. >>>=20 >>> This can be confusing for downstream users, who don't know what message= s >>> like "fragment too large: 1195725856" actually mean, or that they >>> indicate some misconfigured infrastructure elsewhere. >>=20 >> One wonders whether that error message is actually useful at all. >> We could, for example, turn this into a tracepoint, or just get >> rid of it. >=20 > Just going on vague memories here, but: I think we've seen both spurious > and real bugs reported based on this. >=20 > I'm inclined to go with a dprintk or tracepoint but not removing it > entirely. Because this event can be chatty in some cases, I would prefer making it a tracepoint rather than directing it to the log. Note also it would be helpful if the server's net namespace and the client's IP address and port were recorded. Chris, there exists some boilerplate in fs/nfsd/trace.h to help with the latter (just so you can see how to build the trace event definition; you don't have to copy the macros to include/trace/events/sunrpc.h). > --b. >=20 >>=20 >>=20 >>> To allow users to more easily understand and debug these cases, add the >>> number interpreted as ASCII if all characters are printable: >>>=20 >>> RPC: fragment too large: 1195725856 (ASCII "GET ") >>>=20 >>> If demand grows elsewhere, a new printk format that takes a number and >>> outputs it in various formats is also a possible solution. For now, it >>> seems reasonable to put this here since this particular code path is th= e >>> one that has repeatedly come up in production. >>>=20 >>> Signed-off-by: Chris Down >>> Cc: Chuck Lever >>> Cc: J. Bruce Fields >>> Cc: Trond Myklebust >>> Cc: David S. Miller >>> --- >>> net/sunrpc/svcsock.c | 39 +++++++++++++++++++++++++++++++++++++-- >>> 1 file changed, 37 insertions(+), 2 deletions(-) >>>=20 >>> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c >>> index 2e2f007dfc9f..046b1d104340 100644 >>> --- a/net/sunrpc/svcsock.c >>> +++ b/net/sunrpc/svcsock.c >>> @@ -46,6 +46,7 @@ >>> #include >>> #include >>> #include >>> +#include >>>=20 >>> #include >>> #include >>> @@ -863,6 +864,34 @@ static void svc_tcp_clear_pages(struct svc_sock *s= vsk) >>> svsk->sk_datalen =3D 0; >>> } >>>=20 >>> +/* The reclen is taken directly from the first four bytes of the messa= ge with >>> + * the highest bit stripped, which makes it ripe for protocol mixups. = For >>> + * example, if someone tries to send a HTTP GET request to us, we'll i= nterpret >>> + * it as a 1195725856-sized fragment (ie. (u32)'GET '), and print a ra= telimited >>> + * KERN_NOTICE with that number verbatim. >>> + * >>> + * To allow users to more easily understand and debug these cases, thi= s >>> + * function decodes the purported length as ASCII, and returns it if a= ll >>> + * characters were printable. Otherwise, we return NULL. >>> + * >>> + * WARNING: Since we reuse the u32 directly, the return value is not n= ull >>> + * terminated, and must be printed using %.*s with >>> + * sizeof(svc_sock_reclen(svsk)). >>> + */ >>> +static char *svc_sock_reclen_ascii(struct svc_sock *svsk) >>> +{ >>> + u32 len_be =3D cpu_to_be32(svc_sock_reclen(svsk)); >>> + char *len_be_ascii =3D (char *)&len_be; >>> + size_t i; >>> + >>> + for (i =3D 0; i < sizeof(len_be); i++) { >>> + if (!isprint(len_be_ascii[i])) >>> + return NULL; >>> + } >>> + >>> + return len_be_ascii; >>> +} >>> + >>> /* >>> * Receive fragment record header into sk_marker. >>> */ >>> @@ -870,6 +899,7 @@ static ssize_t svc_tcp_read_marker(struct svc_sock = *svsk, >>> struct svc_rqst *rqstp) >>> { >>> ssize_t want, len; >>> + char *reclen_ascii; >>>=20 >>> /* If we haven't gotten the record length yet, >>> * get the next four bytes. >>> @@ -898,9 +928,14 @@ static ssize_t svc_tcp_read_marker(struct svc_sock= *svsk, >>> return svc_sock_reclen(svsk); >>>=20 >>> err_too_large: >>> - net_notice_ratelimited("svc: %s %s RPC fragment too large: %d\n", >>> + reclen_ascii =3D svc_sock_reclen_ascii(svsk); >>> + net_notice_ratelimited("svc: %s %s RPC fragment too large: %d%s%.*s%s= \n", >>> __func__, svsk->sk_xprt.xpt_server->sv_name, >>> - svc_sock_reclen(svsk)); >>> + svc_sock_reclen(svsk), >>> + reclen_ascii ? " (ASCII \"" : "", >>> + (int)sizeof(u32), >>> + reclen_ascii ?: "", >>> + reclen_ascii ? "\")" : ""); >>> set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); >>> err_short: >>> return -EAGAIN; >>> --=20 >>> 2.30.2 >>>=20 >>=20 >> -- >> Chuck Lever -- Chuck Lever