提交 d1d84c96 编写于 作者: J J. Bruce Fields

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: ccae70a9 "nfsd4: estimate sequence response size"
Cc: stable@vger.kernel.org
Reported-by: NChuck Lever <chucklever@gmail.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 f114040e
...@@ -1589,7 +1589,8 @@ static inline u32 nfsd4_rename_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op ...@@ -1589,7 +1589,8 @@ static inline u32 nfsd4_rename_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op
static inline u32 nfsd4_sequence_rsize(struct svc_rqst *rqstp, static inline u32 nfsd4_sequence_rsize(struct svc_rqst *rqstp,
struct nfsd4_op *op) struct nfsd4_op *op)
{ {
return NFS4_MAX_SESSIONID_LEN + 20; return (op_encode_hdr_size
+ XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5) * sizeof(__be32);
} }
static inline u32 nfsd4_setattr_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) static inline u32 nfsd4_setattr_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
...@@ -1893,6 +1894,7 @@ static struct nfsd4_operation nfsd4_ops[] = { ...@@ -1893,6 +1894,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
.op_func = (nfsd4op_func)nfsd4_sequence, .op_func = (nfsd4op_func)nfsd4_sequence,
.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP, .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
.op_name = "OP_SEQUENCE", .op_name = "OP_SEQUENCE",
.op_rsize_bop = (nfsd4op_rsize)nfsd4_sequence_rsize,
}, },
[OP_DESTROY_CLIENTID] = { [OP_DESTROY_CLIENTID] = {
.op_func = (nfsd4op_func)nfsd4_destroy_clientid, .op_func = (nfsd4op_func)nfsd4_destroy_clientid,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册