Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3324236rwi; Sun, 16 Oct 2022 08:56:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6fty+QM4Ws1grn4xEIOCjQsCJI3iMtxQkOzA5tFJ6Y31DaBdBTUUClfwJXfxx6ITkJsIRD X-Received: by 2002:a63:fd09:0:b0:464:4ec8:89b3 with SMTP id d9-20020a63fd09000000b004644ec889b3mr6903054pgh.175.1665935784682; Sun, 16 Oct 2022 08:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665935784; cv=none; d=google.com; s=arc-20160816; b=ii3WJBAT8DVIfBOvPGJUsYAhJNspp4x+l/UAl8iX3QT+0dgkaqkmj6PlU1MZ2+y14R K4IxF7dRFdDg60mIvkdebEVHMITkFzD+e+EfcSS/TbJ2uCSApakhwgLtwPQV9N+IIox8 5YD82ryu3qE1ivQ/eDkyFJpcK65cPtgstOX70GeroVrpvArsD81zrJE3TtNqYROeZTW/ apJPWprPza+Pdxz45gSdev0biuKf8GhWO3nN0Zf6w9wq76hj193tURP94IJJNWcxDP9d yaCJHcmDEPvtyf/3mSCggWPcqX24cVjYjbiz2iQLCV2Xhxfzfr9ZTu2zXsu2+NvIDnE1 gNeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=d2EXA++3/hgic5sUfncEuL263qesRJJSRvpzgSgWqBo=; b=OchWTlnILuG/a8X9qZFWQxFL31DqiBHsyNZe1WdVAjh+n6icKbPbqWMJy0jYKESj32 OFaYMXORcGoyxUtWa5gQ3a9SgLLvlbAECWgmDBGjVnC9Zs6hnRHyvRTapTi7UMk6Xajg tmgirCCvybMkBtenlOIXof9wtmbM96IbVtT/DdHAiOZwaEpp62cuYvJTU43zf/eUFPFV l2plMK2uuGvYi1gAUACFWyGAciFO/5jJngV9kJv71SnTRX78joABUyoowXMR9gxGlw8+ El3+UWCc8gywnkGEu1RaNNmleIdinWSr1tpDQADal7FEWi2KrPjPpiHD/cJf+EIG+Edc a+0Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a631154000000b0043c0b452d3csi9409383pgr.69.2022.10.16.08.56.09; Sun, 16 Oct 2022 08:56:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbiJPPrO (ORCPT + 99 others); Sun, 16 Oct 2022 11:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiJPPrN (ORCPT ); Sun, 16 Oct 2022 11:47:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3179C33863 for ; Sun, 16 Oct 2022 08:47:12 -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 E05CAB80B7E for ; Sun, 16 Oct 2022 15:47:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85F45C433D6 for ; Sun, 16 Oct 2022 15:47:09 +0000 (UTC) Subject: [PATCH 1 3/3] NFSD: Finish converting the NFSv3 GETACL result encoder From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sun, 16 Oct 2022 11:47:08 -0400 Message-ID: <166593522862.1710.16255807600348080659.stgit@klimt.1015granger.net> In-Reply-To: <166593521604.1710.10648202421284171508.stgit@klimt.1015granger.net> References: <166593521604.1710.10648202421284171508.stgit@klimt.1015granger.net> User-Agent: StGit/1.5.dev3+g9561319 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 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. 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(-) 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, struct xdr_stream *xdr) { struct nfsd3_getaclres *resp = rqstp->rq_resp; struct dentry *dentry = resp->fh.fh_dentry; - struct kvec *head = rqstp->rq_res.head; struct inode *inode; - unsigned int base; - int n; - int w; if (!svcxdr_encode_nfsstat3(xdr, resp->status)) return false; @@ -187,26 +183,12 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr) if (xdr_stream_encode_u32(xdr, resp->mask) < 0) return false; - base = (char *)xdr->p - (char *)head->iov_base; - - rqstp->rq_res.page_len = w = 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 -= PAGE_SIZE; - } - - n = nfsacl_encode(&rqstp->rq_res, base, inode, - resp->acl_access, - resp->mask & NFS_ACL, 0); - if (n > 0) - n = nfsacl_encode(&rqstp->rq_res, base + n, inode, - resp->acl_default, - resp->mask & NFS_DFACL, - NFS_ACL_DEFAULT); - if (n <= 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: