Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4422946rwi; Mon, 17 Oct 2022 06:10:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wc8uApBra0q2kolCVpLdg37/AyaW3pbn908JyYOHHY+0DJB1VPHhZTQirdSgmmdB7Z9ay X-Received: by 2002:a17:90b:1b4c:b0:20d:70d8:1491 with SMTP id nv12-20020a17090b1b4c00b0020d70d81491mr33049439pjb.3.1666012208118; Mon, 17 Oct 2022 06:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666012208; cv=none; d=google.com; s=arc-20160816; b=bv1MHPddqUPMKevZZ8ecSQZAK6k6aCYFNsah83eROW95iIFDjV2VuPfjz0CmcCcRFy xAHvb2zH+lUHsEt8Sd0nqOS7wb9e7u0WMEO63UtXme9eFledjrp8NEs/7mm2JqG4ZFrJ OGMJyEShmnlL6MOI9mUg3seqpG2y/+xCjjyxrk/Bt8/pS+8GaPVuasW4BT78CC94BNnG Z4KzrCwqiYlGkw8ZkycL+NPmifUtem1UIQTrqS2GXpkhO2s8boWGFOJyrxhkU0yjxgsD 2x7oKmynfHckIO9O+nJmnz4Efym+kYWsXd9BHxJ9xXxWLQkuUp4VBxZPrHTDLwPz4hEd Dw5Q== 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:to:from :subject:message-id:dkim-signature; bh=8runhL9HSYD8Qkw4U+40aEGY0iYmJh1FED2cx+JkhSY=; b=XTzgjx5RlJlxA/lZpITjjuEMpvsF7ZBqGPji76vBrP3kwTCM5TMlIgCgASgo8vW18j Pncd+yTImLpZ83wvzoP46A4JMY0cNK2QPXcY/0TEmac3/TFxounS12mwUP6WB7hh9KNP OiZCKeyLja1TpRUTdlHLemjO1U33rz9E723e1AMp5EYEGJEBP3zJVqh5VhV28+vJWQWn zBP8HnUu1wYs9NCQSV364cbQxawWnjAWIrsQ4n1LQJMg61+QWR88nTjsRGtr2Tm+itVD amqozjyyacZkMRBopLBWGDBbpeSkpz/p+csVVPiiuqxuZfuIzPlZcL+OwTL3jPemyi3B uzkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T0uWTmAd; 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 a35-20020a631a23000000b004610dceef13si11143199pga.336.2022.10.17.06.09.55; Mon, 17 Oct 2022 06:10:08 -0700 (PDT) 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=T0uWTmAd; 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 S229792AbiJQNE1 (ORCPT + 99 others); Mon, 17 Oct 2022 09:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiJQNES (ORCPT ); Mon, 17 Oct 2022 09:04:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C392A5FADE for ; Mon, 17 Oct 2022 06:04:13 -0700 (PDT) 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 E8385B81637 for ; Mon, 17 Oct 2022 13:04:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63C8EC433D6; Mon, 17 Oct 2022 13:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666011850; bh=ABHmjdx3OdijdTiO5vp0DDDX4rwp8QFnDJ81bxlazEs=; h=Subject:From:To:Date:In-Reply-To:References:From; b=T0uWTmAdXm4UxT7LndEYsBHTscyRZWR6WRoQgMc/mczOUexUlpfr7xM0qSL39IgZn xEyFd6vdPd7fiUBhHH4eEKD50n0FKPoZfsknp/yx88KADYr8rVHHsnJuZ40Moc32BN 9OcRvsqfswQEARqpcEo9D7GUeNdUCMLM8SgmRnWJMmuSC8wot97TmTETiMcoJ0MaJj LvOQkt7ib6xUPnGvSEe/dfgsNk5ZbEkFoYIOBEWhRZ4LU1GXbnLAEtoraxozq3b70B hQ0Eqci7gQVjWH/lI1a+FG70vdmIlo5L4ne/D3/xzetTiMvJEYADHMVN320V+qjrLd nnCWIpuhqIrrQ== Message-ID: <9ae1b87c86abee8e2f7e234256e50fd42fc0e930.camel@kernel.org> Subject: Re: [PATCH 1 3/3] NFSD: Finish converting the NFSv3 GETACL result encoder From: Jeff Layton To: Chuck Lever , linux-nfs@vger.kernel.org Date: Mon, 17 Oct 2022 09:04:08 -0400 In-Reply-To: <166593522862.1710.16255807600348080659.stgit@klimt.1015granger.net> References: <166593521604.1710.10648202421284171508.stgit@klimt.1015granger.net> <166593522862.1710.16255807600348080659.stgit@klimt.1015granger.net> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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 Sun, 2022-10-16 at 11:47 -0400, Chuck Lever wrote: > For some reason, the NFSv2 GETACL result encoder was fully converted > to use the new nfs_stream_encode_acl(), but the NFSv3 equivalent was > not similarly converted. >=20 > Fixes: 20798dfe249a ("NFSD: Update the NFSv3 GETACL result encoder to use= struct xdr_stream") > Signed-off-by: Chuck Lever > --- > fs/nfsd/nfs3acl.c | 30 ++++++------------------------ > 1 file changed, 6 insertions(+), 24 deletions(-) >=20 > diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c > index 9446c6743664..7c798b5f4ec6 100644 > --- a/fs/nfsd/nfs3acl.c > +++ b/fs/nfsd/nfs3acl.c > @@ -171,11 +171,7 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, str= uct xdr_stream *xdr) > { > struct nfsd3_getaclres *resp =3D rqstp->rq_resp; > struct dentry *dentry =3D resp->fh.fh_dentry; > - struct kvec *head =3D rqstp->rq_res.head; > struct inode *inode; > - unsigned int base; > - int n; > - int w; > =20 > if (!svcxdr_encode_nfsstat3(xdr, resp->status)) > return false; > @@ -187,26 +183,12 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, st= ruct xdr_stream *xdr) > if (xdr_stream_encode_u32(xdr, resp->mask) < 0) > return false; > =20 > - base =3D (char *)xdr->p - (char *)head->iov_base; > - > - rqstp->rq_res.page_len =3D w =3D nfsacl_size( > - (resp->mask & NFS_ACL) ? resp->acl_access : NULL, > - (resp->mask & NFS_DFACL) ? resp->acl_default : NULL); > - while (w > 0) { > - if (!*(rqstp->rq_next_page++)) > - return false; > - w -=3D PAGE_SIZE; > - } > - > - n =3D nfsacl_encode(&rqstp->rq_res, base, inode, > - resp->acl_access, > - resp->mask & NFS_ACL, 0); > - if (n > 0) > - n =3D nfsacl_encode(&rqstp->rq_res, base + n, inode, > - resp->acl_default, > - resp->mask & NFS_DFACL, > - NFS_ACL_DEFAULT); > - if (n <=3D 0) > + if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access, > + resp->mask & NFS_ACL, 0)) > + return false; > + if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default, > + resp->mask & NFS_DFACL, > + NFS_ACL_DEFAULT)) > return false; > break; > default: >=20 >=20 Much cleaner. Reviewed-by: Jeff Layton