From patchwork Mon Feb 20 20:27:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 9583611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9445600C1 for ; Mon, 20 Feb 2017 20:27:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA248284BA for ; Mon, 20 Feb 2017 20:27:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEAEC2852B; Mon, 20 Feb 2017 20:27:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2462B284BA for ; Mon, 20 Feb 2017 20:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751805AbdBTU1e (ORCPT ); Mon, 20 Feb 2017 15:27:34 -0500 Received: from fieldses.org ([173.255.197.46]:38642 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbdBTU1d (ORCPT ); Mon, 20 Feb 2017 15:27:33 -0500 Received: by fieldses.org (Postfix, from userid 2815) id E59992692; Mon, 20 Feb 2017 15:27:31 -0500 (EST) Date: Mon, 20 Feb 2017 15:27:31 -0500 To: "J. Bruce Fields" Cc: Kinglong Mee , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, Andreas Gruenbacher , Weston Andros Adamson Subject: [PATCH] NFSv4: fix getacl head length estimation Message-ID: <20170220202731.GA20882@fieldses.org> References: <1487470070-32358-1-git-send-email-bfields@redhat.com> <1487470070-32358-2-git-send-email-bfields@redhat.com> <81d554b6-7b8d-51e8-c7ad-b23acd70f717@gmail.com> <20170220155019.GA12335@parsley.fieldses.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170220155019.GA12335@parsley.fieldses.org> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" Bitmap and attrlen follow immediately after the op reply header. This was an oversight from commit bf118a342f. Consequences of this are just minor efficiency (extra calls to xdr_shrink_bufhead). Fixes: bf118a342f10 "NFSv4: include bitmap in nfsv4 get acl data" Reviewed-by: Kinglong Mee Signed-off-by: J. Bruce Fields --- fs/nfs/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) On Mon, Feb 20, 2017 at 10:50:19AM -0500, J. Bruce Fields wrote: > Thanks for the history, and the review. I've added a "Fixes: > bf118a342f10" line. diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e9255cb453e6..bb95dd2edeef 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -2524,7 +2524,7 @@ static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr, encode_compound_hdr(xdr, req, &hdr); encode_sequence(xdr, &args->seq_args, &hdr); encode_putfh(xdr, args->fh, &hdr); - replen = hdr.replen + op_decode_hdr_maxsz + 1; + replen = hdr.replen + op_decode_hdr_maxsz; encode_getattr_two(xdr, FATTR4_WORD0_ACL, 0, &hdr); xdr_inline_pages(&req->rq_rcv_buf, replen << 2,