On 2/19/2017 10:07, J. Bruce Fields wrote: > From: "J. Bruce Fields" <bfields@xxxxxxxxxx> > > 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@xxxxxxxxxx> > --- > 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@xxxxxxxxx> 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, > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html