Skip to content

Commit d1d84c9

Browse files
author
J. Bruce Fields
committed
nfsd4: fix response size estimation for OP_SEQUENCE
We added this new estimator function but forgot to hook it up. The effect is that NFSv4.1 (and greater) won't do zero-copy reads. The estimate was also wrong by 8 bytes. Fixes: ccae70a "nfsd4: estimate sequence response size" Cc: [email protected] Reported-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent f114040 commit d1d84c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,8 @@ static inline u32 nfsd4_rename_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op
15891589
static inline u32 nfsd4_sequence_rsize(struct svc_rqst *rqstp,
15901590
struct nfsd4_op *op)
15911591
{
1592-
return NFS4_MAX_SESSIONID_LEN + 20;
1592+
return (op_encode_hdr_size
1593+
+ XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5) * sizeof(__be32);
15931594
}
15941595

15951596
static inline u32 nfsd4_setattr_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
@@ -1893,6 +1894,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
18931894
.op_func = (nfsd4op_func)nfsd4_sequence,
18941895
.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
18951896
.op_name = "OP_SEQUENCE",
1897+
.op_rsize_bop = (nfsd4op_rsize)nfsd4_sequence_rsize,
18961898
},
18971899
[OP_DESTROY_CLIENTID] = {
18981900
.op_func = (nfsd4op_func)nfsd4_destroy_clientid,

0 commit comments

Comments
 (0)