linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@redhat.com>,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	Anna Schumaker <schumakeranna@gmail.com>
Cc: linux-nfs@vger.kernel.org,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Weston Andros Adamson <dros@primarydata.com>,
	Kinglong Mee <kinglongmee@gmail.com>
Subject: Re: [PATCH 1/6] NFSv4: fix getacl head length estimation
Date: Mon, 20 Feb 2017 21:19:14 +0800	[thread overview]
Message-ID: <81d554b6-7b8d-51e8-c7ad-b23acd70f717@gmail.com> (raw)
In-Reply-To: <1487470070-32358-2-git-send-email-bfields@redhat.com>

On 2/19/2017 10:07, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@redhat.com>
> 
> Bitmap and attrlen follow immediately after the op reply header, so I'm
> not sure what this extra "+1" was for.
> 
> Consequences of this are just minor efficiency (extra calls to
> xdr_shrink_bufhead).
> 
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> ---
>  fs/nfs/nfs4xdr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;

The +1 is set at 28f566942c "NFS: use dynamically computed compound_hdr.replen
for xdr_inline_pages offset", 

@@ -1827,20 +1806,18 @@ nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p,
        xdr_init_encode(&xdr, &req->rq_snd_buf, p);
        encode_compound_hdr(&xdr, req, &hdr);
        encode_putfh(&xdr, args->fh, &hdr);
+       replen = hdr.replen + nfs4_fattr_bitmap_maxsz + 1;
        encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr);

-       /* set up reply buffer: */
-       replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_getacl_sz) << 2;
-       xdr_inline_pages(&req->rq_rcv_buf, replen,
+       xdr_inline_pages(&req->rq_rcv_buf, replen << 2,
                args->acl_pages, args->acl_pgbase, args->acl_len);
        encode_nops(&hdr);
        return 0;

#define NFS4_dec_getacl_sz      (compound_decode_hdr_maxsz + \
                                decode_sequence_maxsz + \
                                decode_putfh_maxsz + \
                                *decode_getacl_maxsz*)

#define decode_getacl_maxsz     (op_decode_hdr_maxsz + \
                                 nfs4_fattr_bitmap_maxsz + 1)

But, forget remove it at commit bf118a342f,
"NFSv4: include bitmap in nfsv4 get acl data".

Reviewed-by: Kinglong Mee <kinglongmee@gmail.com>

thanks,
Kinglong Mee
> +	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,
> 

  reply	other threads:[~2017-02-20 13:19 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 16:44 [PATCH 0/3] getacl fixes J. Bruce Fields
2017-02-17 16:44 ` [PATCH 1/3] nfsd4: fix getacl head length estimation J. Bruce Fields
2017-02-17 16:44 ` [PATCH 2/3] NFSv4: fix getacl ERANGE for some ACL buffer sizes J. Bruce Fields
2017-02-17 16:44 ` [PATCH 3/3] nfsd4: simplify getacl decoding J. Bruce Fields
2017-02-17 19:15   ` kbuild test robot
2017-02-17 19:33     ` J. Bruce Fields
2017-02-17 19:35   ` kbuild test robot
2017-02-17 19:35   ` [PATCH] nfsd4: fix ifnullfree.cocci warnings kbuild test robot
2017-02-17 19:34     ` J. Bruce Fields
2017-02-17 20:36 ` [PATCH 0/3] getacl fixes Chuck Lever
2017-02-17 20:52   ` J. Bruce Fields
2017-02-17 21:21     ` Chuck Lever
2017-02-19  2:07 ` [PATCH 0/6] getacl fixes V2 J. Bruce Fields
2017-02-19  2:07   ` [PATCH 1/6] NFSv4: fix getacl head length estimation J. Bruce Fields
2017-02-20 13:19     ` Kinglong Mee [this message]
2017-02-20 15:50       ` J. Bruce Fields
2017-02-20 20:27         ` [PATCH] " J. Bruce Fields
2017-02-19  2:07   ` [PATCH 2/6] NFSv4: fix getacl ERANGE for some ACL buffer sizes J. Bruce Fields
2017-02-21 19:46     ` Weston Andros Adamson
2017-02-22 22:36       ` J. Bruce Fields
2017-02-23 14:55         ` Anna Schumaker
2017-02-23 19:43           ` J. Bruce Fields
2017-02-23 19:53             ` [PATCH 1/2] NFSv4: fix getacl head length estimation J. Bruce Fields
2017-02-23 19:54               ` [PATCH 2/2] NFSv4: fix getacl ERANGE for some ACL buffer sizes J. Bruce Fields
2017-02-23 21:54                 ` Anna Schumaker
2017-02-19  2:07   ` [PATCH 3/6] NFSv4: minor acl caching policy documentation J. Bruce Fields
2017-02-19  2:07   ` [PATCH 4/6] NFSv4: minor getacl cleanup J. Bruce Fields
2017-02-20 22:38     ` Andreas Gruenbacher
2017-02-19  2:07   ` [PATCH 5/6] NFSv4: simplify getacl decoding J. Bruce Fields
2017-02-20 22:30     ` Andreas Gruenbacher
2017-02-19  2:07   ` [PATCH 6/6] NFSv4: allow getacl rpc to allocate pages on demand J. Bruce Fields
2017-02-19 19:29     ` Chuck Lever
2017-02-20 16:09       ` J. Bruce Fields
2017-02-20 16:42         ` Chuck Lever
2017-02-20 17:15           ` J. Bruce Fields
2017-02-20 21:31             ` Andreas Gruenbacher
2017-02-21 18:46               ` Chuck Lever
2017-02-21 21:21                 ` Andreas Gruenbacher
2017-02-21 21:37                   ` J. Bruce Fields
2017-02-21 21:45                     ` Andreas Gruenbacher
2017-02-22  1:53                       ` J. Bruce Fields
2017-02-23 10:28                         ` Andreas Gruenbacher
2017-02-23 20:20                           ` J. Bruce Fields
2017-02-20 22:38     ` Andreas Gruenbacher
2017-02-21 18:35       ` J. Bruce Fields
2017-02-21 19:45         ` Weston Andros Adamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81d554b6-7b8d-51e8-c7ad-b23acd70f717@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=agruenba@redhat.com \
    --cc=bfields@redhat.com \
    --cc=dros@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=schumakeranna@gmail.com \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).