Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp207386rdb; Thu, 18 Jan 2024 00:43:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+rrN0x5PgljjutiKPyuDb9jKxLPMj6GASvfOUa7+VTuqKwc8vwndXXsZic7EUObuIYUDW X-Received: by 2002:a17:907:934c:b0:9fe:81a:c258 with SMTP id bv12-20020a170907934c00b009fe081ac258mr378301ejc.26.1705567382607; Thu, 18 Jan 2024 00:43:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705567382; cv=pass; d=google.com; s=arc-20160816; b=Cm/qXgsJJALhEldWo4ev3kA5jwXSQHAZlNC3MaZuGyf9kFlNirawLZqGdfE4hWKDdI XZFgsTZMzsph1anGzDVZYeNKb2un1do6tOzU7Yw+T7f0zGlfP+ke+A8GwCwsiveD2EAk RfRQlqaec1kUBrFE7bjaSFQuiGHx/+CA2Vjg6jGdxMDgvrEI6DmS5p7eSJT5FogfEEcT TX7QTViULpopKynMAp2+9mjHUX/Aq/4G8jTB22noNZqR+DwHQBQdcPoiFEiMOc1lQJUz pQlC4WgSTE5MaAIhBAKfjkTTYZg3CVDG8ATVihdErTUftxvNChw2HnwwhAUmX17hsi/X Y3mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=UlX+u/2pTt3JL2KkwnD8s3dx0LWjmAeWHrQ3M0Rcins=; fh=hbkwLBqDxpc2QaCsHw1SszhBp8367dK+SjNec23p+Gs=; b=iYEeguJ8YxluM81PBQppM6pPPyW3swOaFwuXFuhs8LHpacwACI4jCs9uLt07h4hnux 800+51qt35Xzw61DTtft47ypHojlXEFFXhy5IVDpH+/jWojB1Z1zfzGK/0DUCakykDAa ZzFp6A3kb5O+hjiKIYHrWSux45dTAuVQOd1N+OXP05/dsYBec3vPZ+1iYW8ffo4fWjNF YBcJqFudM+aEN/EqXBQ3eCE02oD9kJsH9J6PSIHyBcBE6yaWOla1Qpr8A16prSlblIZL I9gzP/KdkZtM/3iboGxkwqm+lMeeE6qAHtZP9ZSoferxnj3QErZWGk+o7UallwvlnGoP ug6w== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-nfs+bounces-1198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1198-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b2-20020a170906490200b00a2d5d738fcdsi4277836ejq.54.2024.01.18.00.43.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 00:43:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-nfs+bounces-1198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1198-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 521F61F21B74 for ; Thu, 18 Jan 2024 08:43:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D7961F60B; Thu, 18 Jan 2024 08:42:59 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07DFA1F5F7 for ; Thu, 18 Jan 2024 08:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705567379; cv=none; b=WuXEX65oKOjT3ihtrnTXCtQzvjYVKeguzZCd6aiTjj52GXXhbM7FTzjN+cihkbEm/di0ESnZdu4A6ALSisP1xh/aVCTZ1NaVxyqQ6o6h+QY5lhqxcHqeKQBE5VHgzPI1uUZPlLlMqPMeAalcdMuGLnaTmodLrACHuuysEf5REGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705567379; c=relaxed/simple; bh=tMU0E1Q78JCelu6nEjfXAqzABJfq+Qqbl14OCc6pEoU=; h=Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:User-Agent: MIME-Version:X-SA-Exim-Connect-IP:X-SA-Exim-Mail-From: X-SA-Exim-Scanned:X-PTX-Original-Recipient; b=IARDK0S+z7xFJPPQcNbEKCi1+kkOWBeACpW65vSl8cb5kCg39qwaKjInr/Bj4g6JKoLiow1LTJKBs7CGna2Q6mAadJk/haurln/4eGPFOc9J4NODMx7E/+j5sLrDNFkHz6zIq7gZyYlGX2m7tVRTMiDj1tN2qlHDmfJiiL+jWhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[IPv6:::1]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQNz2-0006qB-Ev; Thu, 18 Jan 2024 09:42:44 +0100 Message-ID: <3b4b548b5d7ede4632a113304cab38002f4aa2e1.camel@pengutronix.de> Subject: Re: [PATCH] SUNRPC: use request size to initialize bio_vec in svc_udp_sendto() From: Lucas Stach To: Chuck Lever Cc: Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, kernel@pengutronix.de, patchwork-lst@pengutronix.de Date: Thu, 18 Jan 2024 09:42:42 +0100 In-Reply-To: References: <20240117210628.1534046-1-l.stach@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-nfs@vger.kernel.org Am Mittwoch, dem 17.01.2024 um 17:03 -0500 schrieb Chuck Lever: > On Wed, Jan 17, 2024 at 10:06:28PM +0100, Lucas Stach wrote: > > Use the proper size when setting up the bio_vec, as otherwise only > > zero-length UDP packets will be sent. > >=20 > > Fixes: baabf59c2414 ("SUNRPC: Convert svc_udp_sendto() to use the per-s= ocket bio_vec array") > > Signed-off-by: Lucas Stach > > --- > > net/sunrpc/svcsock.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c > > index 998687421fa6..e0ce4276274b 100644 > > --- a/net/sunrpc/svcsock.c > > +++ b/net/sunrpc/svcsock.c > > @@ -717,12 +717,12 @@ static int svc_udp_sendto(struct svc_rqst *rqstp) > > ARRAY_SIZE(rqstp->rq_bvec), xdr); > > =20 > > iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, > > - count, 0); > > + count, rqstp->rq_res.len); > > err =3D sock_sendmsg(svsk->sk_sock, &msg); > > if (err =3D=3D -ECONNREFUSED) { > > /* ICMP error on earlier request. */ > > iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, > > - count, 0); > > + count, rqstp->rq_res.len); > > err =3D sock_sendmsg(svsk->sk_sock, &msg); > > } > > =20 > > --=20 > > 2.43.0 > >=20 >=20 > I can't fathom why I would have chosen zero for the @count argument. >=20 > We currently have zero test coverage for UDP. I'll look into that. >=20 > I've applied this to the nfsd-fixes branch. It should appear in > v6.8-rc if I can get it tested. Thanks. For what it is worth, this fix didn't come out of pure code inspection, but fixes a real world setup for me. While I can't claim that I have any kind of comprehensive testing, this fix has at least shown to fix the issue introduced in the referenced commit in my setup. Regards, Lucas