Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1092199pxu; Mon, 23 Nov 2020 11:25:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2PyBj7Wnh5yu8pK+DQmcvKRvOENjLUr+1fKKeAss82HSGu5hqobv4cL2tKiHKxe/SKf08 X-Received: by 2002:a17:907:2175:: with SMTP id rl21mr1032855ejb.59.1606159512874; Mon, 23 Nov 2020 11:25:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606159512; cv=none; d=google.com; s=arc-20160816; b=xcZnm1IWc1bwGPaXbUBmz/9KHvNDwm7kN6ElnO0OInhT43lqe423Wchv+MHLsojOSN m7mYPpEyCkbLrZEMgntKmILM4aNW0jnq8TfL9lSMfqRxDfaNBdz8+cwdeXksKU1ih/U0 gWP1Fl662dqU++/hxMvg4yxM3c/xf3Nw7OeVIVIjauF3r/hgeqhL+pkBTXSivA8q9bHi ze7Nr1uvGp2ITf3h/98iLfj4NithW6fP1rxXtArrs3EmcAth9t9UcUhO5aVCWVNvZ0/D x/mLOILLMQ1FBK8gLeW/EBd7ztXzGdRVGqbFQE7BoKbWiFdw4QRhnzWR1RknexePefY2 HEOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qprakT3d/KEOlMK4AKKkn5b9A9v4AWBvkvQi0H4fgP0=; b=GPJgO98DH3BAEhhsqHb+8eMX4w5aPWFlfbp558EMkGFtoOQXNiCvif7JVGAZTVWRKt V8+fJrcU4KKhC2NvWw+llJxj+2Ak9ZtcCWjk/Igp9smTaBeySPiwgnDj8JTx/dFuoTMN ksibGSLlpDvW2z6pRf0I4B6BYGauZK9FMdmsYgzsyCrZ1LPUxsNk2dYfu5tzwhuIgZJg n5zQLuLrvZx5b9su/7oeSsW1eImPYg0oUYzQ2r4aaELjNhTYNMzOPpXiwSNj3xN3DK4F ybmOZCxvKFmk+J71xZ2cc/NCuUmJwvpzH9mZH3KiAjYTiteEeRDgXzU0Q08myQf+lRGx uj+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=KcezmVJ1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si7632373ejs.429.2020.11.23.11.24.48; Mon, 23 Nov 2020 11:25:12 -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=@amazon.com header.s=amazon201209 header.b=KcezmVJ1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729982AbgKWTYq (ORCPT + 99 others); Mon, 23 Nov 2020 14:24:46 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:36034 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729420AbgKWTYp (ORCPT ); Mon, 23 Nov 2020 14:24:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1606159486; x=1637695486; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=qprakT3d/KEOlMK4AKKkn5b9A9v4AWBvkvQi0H4fgP0=; b=KcezmVJ1T8FQMtswdNLr2y7O+gmxWx1eYIuDBa0hmk4yOCCnkQslmwBa 6PEDdwYJGUpU6+KbJbSuywlVC6svxDmpB3BotuonCAmQlk4Fb8AGsMBVE f60b+pHiiSNtYqYVAFJtrjyoj2SGX1rakyv+ftTXLO/gwA3Jpy05JyNnG s=; X-IronPort-AV: E=Sophos;i="5.78,364,1599523200"; d="scan'208";a="65640694" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 23 Nov 2020 19:24:39 +0000 Received: from EX13MTAUEB002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) with ESMTPS id B3FFDA007F; Mon, 23 Nov 2020 19:24:36 +0000 (UTC) Received: from EX13D13UEB001.ant.amazon.com (10.43.60.86) by EX13MTAUEB002.ant.amazon.com (10.43.60.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 23 Nov 2020 19:24:35 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D13UEB001.ant.amazon.com (10.43.60.86) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 23 Nov 2020 19:24:35 +0000 Received: from dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (172.23.141.97) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 23 Nov 2020 19:24:35 +0000 Received: by dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (Postfix, from userid 6262777) id 64EE4C142A; Mon, 23 Nov 2020 19:24:34 +0000 (UTC) Date: Mon, 23 Nov 2020 19:24:34 +0000 From: Frank van der Linden To: Olga Kornievskaia CC: Chuck Lever , Trond Myklebust , Anna Schumaker , Linux NFS Mailing List Subject: Re: [UNVERIFIED SENDER] Re: [PATCH 1/1] NFSv4.2: fix LISTXATTR buffer receive size Message-ID: <20201123192434.GB28906@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> References: <20201113190851.7817-1-olga.kornievskaia@gmail.com> <99874775-A18C-4832-A2F0-F2152BE5CE32@oracle.com> <07AF9A5C-BC42-4F66-A153-19A410D312E1@oracle.com> <7E0CD3F3-84F2-4D08-8D5A-37AA0FA4852D@oracle.com> <20201119232647.GA11369@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> <20201123173802.GA26158@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20201123173802.GA26158@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> User-Agent: Mutt/1.11.4 (2019-03-13) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Nov 23, 2020 at 05:38:02PM +0000, Frank van der Linden wrote: > It wouldn't be the end of the world to change LISTXATTRS (and GETXATTR) > to use preallocated pages. But, I didn't do that because I didn't want to > waste the max size (64k) every time, even though you usually just get > a few hundred bytes at most. So it seems like fixing XDRBUF_SPARSE_PAGES > is cleaner. Correcting myself here.. this is true of GETXATTR, since there is no maximum length argument for that call - so your only choice is to allocate the max of what you can handle, and SPARSE seems to be the best option fr that. For LISTXATTRS, there is a max length argument. It's a bit unusual, in that it specifies the maximum number of bytes of *XDR* data you want to receive. So you don't need to allocate the maximum number of pages. But, I decided to still use the SPARSE option, since the common 0 length argument to the listxattr syscall, used to probe the length of the buffer needed, would still require the maximum length (64k) to be allocated, because there is no 0 lengh 'probe' option for the RPC. So all you can do is ask for the maximum size you can handle, and see what you get back to determine the length. Olga's comment about caching: the code actually does cache the data for all valid replies, even if the system call only was a len == 0 probe call. That way, the followup system call that actually retrieves the data can normally just get it from the cache. In any case, I need to set up an RDMA environment to see if I can reproduce and fix the issue. I hope to do that today or tomorrow. - Frank