Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp400323rwb; Thu, 1 Dec 2022 03:46:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ViOF3l/In1oevX9Ah6Kru/EnIr0t2DUje3VwXVor/GLwwK0pl+Km+WtqW/IzKRV7wYzU0 X-Received: by 2002:a17:906:6a8e:b0:78d:a136:7332 with SMTP id p14-20020a1709066a8e00b0078da1367332mr54851909ejr.355.1669895166069; Thu, 01 Dec 2022 03:46:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669895166; cv=none; d=google.com; s=arc-20160816; b=dnrBDKPMPhXKCxwX0y7C3BPBLMvNsHltR05Ago0ktkp6LKF1j7mtFn4YL5heD5VqAT eZe5uyf481ibaPoaQx1WfkQQ3N6WHnQCa4BDZV06lqWsHXjMSISel4LdqpNCL04b9SxG uaZMxzqb84bXakK6KpC6mR11As9H61inTlEQlAp0MIxHcqyf0UyUg0ng/jnfdCgBEj/5 skT0w20YsW5hxmyso2OJsEqD/+UR8nVaOqo+kSGCX1r1OlxwzVgjW4GBdt8PAYTafLwB 6NTWB77MKddkAkLYj8VSNUibHW5Ry3Szmpj3G9WwRkX/y/gT/TBmYt3NHoeAzLphlrNb +VJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Qjoxoi9xoNRA51bpvWCVADxKhGIWkN4TksDrjqemQzs=; b=MHGBxBLyYXCH8FvXo5KNW61PZX9TdLQeqIS1F5zsOExGIxISNj26kJ0KLFjm2WtjLS GIsLPYNF0+shyK1oCblfWKS7S7ulN0Hjr0I3rRC6k+aPlwF+ReEfH05X3aGi/oZ5wPPR ebbP9E+hqD36icU4D8AyTHt/OJpFLjvsu98UpAChxnRhtYBlZgBBp7DRzXckmzdunMVX 3voJImHTOyM4dE2mjt0so9f7rB+5OIP3VDV4ciz9VmmGmSD4LbiUV6OJcRLVU1cicsg6 VMC3HzMFcD8+G+wNbK48purrzmxrTZKpNp+TNB0rjj8/vhOLEX0WFCPLahk/VmaXLyPt gEPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nXWxCzuJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a05640250cb00b0045d3e06e4d5si3941159edb.389.2022.12.01.03.45.30; Thu, 01 Dec 2022 03:46:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nXWxCzuJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbiLALoc (ORCPT + 99 others); Thu, 1 Dec 2022 06:44:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbiLALob (ORCPT ); Thu, 1 Dec 2022 06:44:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9F019D80B for ; Thu, 1 Dec 2022 03:44:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 55384B81F15 for ; Thu, 1 Dec 2022 11:44:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F7D7C433C1; Thu, 1 Dec 2022 11:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669895068; bh=+Djz83ttlR4v6J3lkgiBTyrL/P156r42LXK+kAKwQBw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=nXWxCzuJFhqsuIkFfTTev8weo2V0hYLDgjh/UPR+RFffGF7l6UyMPeyia27VnZjKH 5fOav5jGyKXvm5HJjrVbHvFdLBn1yUryfjwaVlU3GE+1NoKwnpKANxoKw2243gzfgC HIHy8KGnRoy4eW4WiCE1rFdxNsU+V6gUVv+jeEegYjoPelHEyFtwDR+vi9F6spKtZW fTC4xep5hBmUdb8Aa4FXZzSUShiWqGi9QHCOXZAbCExmGS2OFIeaCENyY0PUwn/KKW gJWyO05vj3J9keeooqZzAgppvUPIwa+mrHsKi3oedFJnhWI41MQeGAaqvVTjEJKCPb 05vrJBbW/DPOA== Message-ID: <23eddc9b078dd50f48d6bc7b0084f456dd4f1f9d.camel@kernel.org> Subject: Re: [PATCH] NFS: Allow very small rsize & wsize again From: Jeff Layton To: Anna Schumaker , linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com Cc: tom@talpey.com Date: Thu, 01 Dec 2022 06:44:26 -0500 In-Reply-To: <20221130203047.1303804-1-anna@kernel.org> References: <20221130203047.1303804-1-anna@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.1 (3.46.1-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 2022-11-30 at 15:30 -0500, Anna Schumaker wrote: > From: Anna Schumaker >=20 > 940261a19508 introduced nfs_io_size() to clamp the iosize to a multiple > of PAGE_SIZE. This had the unintended side effect of no longer allowing > iosizes less than a page, which could be useful in some situations. >=20 > UDP already has an exception that causes it to fall back on the > power-of-two style sizes instead. This patch adds an additional > exception for very small iosizes. >=20 > Reported-by: Jeff Layton > Fixes: 940261a19508 ("NFS: Allow setting rsize / wsize to a multiple of P= AGE_SIZE") > Signed-off-by: Anna Schumaker > --- > fs/nfs/internal.h | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h > index 647fc3f547cb..ae7d4a8c728c 100644 > --- a/fs/nfs/internal.h > +++ b/fs/nfs/internal.h > @@ -739,12 +739,10 @@ unsigned long nfs_io_size(unsigned long iosize, enu= m xprt_transports proto) > iosize =3D NFS_DEF_FILE_IO_SIZE; > else if (iosize >=3D NFS_MAX_FILE_IO_SIZE) > iosize =3D NFS_MAX_FILE_IO_SIZE; > - else > - iosize =3D iosize & PAGE_MASK; > =20 > - if (proto =3D=3D XPRT_TRANSPORT_UDP) > + if (proto =3D=3D XPRT_TRANSPORT_UDP || iosize < PAGE_SIZE) > return nfs_block_bits(iosize, NULL); > - return iosize; > + return iosize & PAGE_MASK; > } > =20 > /* Looks good. Thanks, Anna. Reviewed-by: Jeff Layton