Received: by 2002:a25:6ac4:0:0:0:0:0 with SMTP id f187csp2267461ybc; Thu, 19 Mar 2020 15:14:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsPdyPbzDpebNXfs5j0lde63J5Y+JJOEK6wSEeAB2Xo3joiPSSjAMIdfUXiyiYw2awi6oLT X-Received: by 2002:aca:5454:: with SMTP id i81mr4211348oib.23.1584656084167; Thu, 19 Mar 2020 15:14:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584656084; cv=none; d=google.com; s=arc-20160816; b=HgbgwaGuSAlwOWP7/f+07OkX2agIpZHNe2VE2VJz+LSIE50nQvoTADLfXlOfQsPNku pCqro1Qb4zOPplwBPhFzZTQBAoP92zRTYW3WcaKUpADItY8OkEBDV+QrtFVvXVOAXkoy xQDyXQUWDB9PGLmwAAllJoNMoqH85DMQMuqBP1fijxK37JK9osi6EOEFgyuPrYi9jZm6 ZEljQ/WQkgN+5y7GELZleqSqjydDrgsWX0Nqh94VgeHm5kFsiib3CDlz9zkPvOc2+V1q TG260wHAG+PfMrUH7KvDcEM6Y/mfqFPXjUlQX9hE7IdG+uDV9SoTi7w12Gvg2XBnHe9I S63g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:cc:to:from :date:subject:ironport-sdr:dkim-signature; bh=P+GcJ3nQC52H8ooN0sQKgDWS2OzM/zXfR3vd3OfdEQg=; b=uWvMYsiX3a0RCiJJe6SnImX9jTqiNTTlAc0n9B5QarsFJrr4v3TtN01LHTtwlETDm7 kFsTt/vhDSG2WbkkUZ+k60xw3znB7GCiMx9fQZcl7CTspJsbf0cNSXgcL1BceQO2rewu Vl7exEMkYHHQuA+av/3YcQw1+t3g+YiO3XgnukpdPURH1zKAxPYvyg7eXfyc/slGB3Gc C2X6LsuE2G3IQR5AKwDwto8nEZduSI7S24ciD0gNqwSrIxMiURyucHauNB7MgfUzHfYi lirV69I+ut3aDS+D3dQnWHl92uYTyix8etM6/XwgKgETjXpljGtHXnDhlXmO0Peytoaf k+uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Nw7vpfw+; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u1si1980321otg.231.2020.03.19.15.14.07; Thu, 19 Mar 2020 15:14:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Nw7vpfw+; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 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 S1727466AbgCSWNz (ORCPT + 99 others); Thu, 19 Mar 2020 18:13:55 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:6279 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727383AbgCSWNz (ORCPT ); Thu, 19 Mar 2020 18:13:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1584656034; x=1616192034; h=date:from:to:cc:message-id:references:mime-version: in-reply-to:subject; bh=P+GcJ3nQC52H8ooN0sQKgDWS2OzM/zXfR3vd3OfdEQg=; b=Nw7vpfw+KQ1azh6mJR7BHiR3zEl399fKbeOc5N0woTLXOPB+OgAuHNDv nnjLX2P7H5n6EGlvzm5Yf7daCpRpfiNczQ7+fD4ucXiLapg4jJdR8YYBy Zl0JmMoVqiAhQG4VTgWLHsKC9K1iH50RmKsXPolg2yw1YDXUJK2FjmuDq A=; IronPort-SDR: zxFNEpjmlHwdMh5ZO70mHdH2+R3TgDshxijzckG3JQo3Phak4d+9AmUnbZC/TSegnutGjiMwSn C9KUewajnSKQ== X-IronPort-AV: E=Sophos;i="5.70,573,1574121600"; d="scan'208";a="33638905" Subject: Re: [PATCH 11/14] nfsd: add user xattr RPC XDR encoding/decoding logic Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 19 Mar 2020 22:13:52 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com (Postfix) with ESMTPS id C04EEA25C7; Thu, 19 Mar 2020 22:13:51 +0000 (UTC) Received: from EX13D07UWB003.ant.amazon.com (10.43.161.66) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 19 Mar 2020 22:13:51 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D07UWB003.ant.amazon.com (10.43.161.66) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Mar 2020 22:13:51 +0000 Received: from dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (172.23.141.97) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 19 Mar 2020 22:13:50 +0000 Received: by dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (Postfix, from userid 6262777) id ADBF9CE71E; Thu, 19 Mar 2020 22:13:50 +0000 (UTC) Date: Thu, 19 Mar 2020 22:13:50 +0000 From: Frank van der Linden To: Chuck Lever CC: Bruce Fields , Linux NFS Mailing List Message-ID: <20200319221350.GA18279@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> References: <20200311195954.27117-1-fllinden@amazon.com> <20200311195954.27117-12-fllinden@amazon.com> <17D7709F-2FE0-4B84-A9AF-4D6C2B36A4E7@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <17D7709F-2FE0-4B84-A9AF-4D6C2B36A4E7@oracle.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Mar 12, 2020 at 12:24:18PM -0400, Chuck Lever wrote: > > +static inline u32 nfsd4_getxattr_rsize(struct svc_rqst *rqstp, > > + struct nfsd4_op *op) > > +{ > > + u32 maxcount, rlen; > > + > > + maxcount = svc_max_payload(rqstp); > > + rlen = min_t(u32, XATTR_SIZE_MAX, maxcount); > > + > > + return (op_encode_hdr_size + 1 + XDR_QUADLEN(rlen)) * sizeof(__be32); > > These should be added in the same patch that adds OP_GETXATTR and friends. > > Also, Trond recently added xdr_align_size which I prefer over the > use of XDR_QUADLEN in new code. Thanks, I've squashed together those patches for this and the other reasons you pointed out. As for XDR_QUADLEN: that returns the 32bit-word rounded up lenghth - in words. xdr_aligned_size returns the 32bit-word rounded up length - in bytes. So, the result would then look something like: return xdr_align_size((op_encode_hdr_size * 4) + 4 + rlen); Is that what you're suggesting? - Frank