public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfsd4: fix response size estimation for OP_SEQUENCE
@ 2014-10-17 21:24 J. Bruce Fields
  2014-10-21 10:36 ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: J. Bruce Fields @ 2014-10-17 21:24 UTC (permalink / raw)
  To: linux-nfs; +Cc: Chuck Lever

From: "J. Bruce Fields" <bfields@redhat.com>

We added this new estimator function but forgot to hook it up.  The
effect is that NFSv4.1 won't do zero-copy reads.

The estimate was also wrong by 8 bytes.

Fixes: ccae70a9ee41 "nfsd4: estimate sequence response size"
Cc: stable@vger.kernel.org
Reported-by: Chuck Lever <chucklever@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4proc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Whoops, this should have gone in some time ago but I lost it somehow.
Thanks to Chuck for noticing the oversight.

I'll pass it along upstream soon.--b.

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index cdeb3cf..f990983 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -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,
 				       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)
@@ -1893,6 +1894,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
 		.op_func = (nfsd4op_func)nfsd4_sequence,
 		.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
 		.op_name = "OP_SEQUENCE",
+		.op_rsize_bop = (nfsd4op_rsize)nfsd4_sequence_rsize,
 	},
 	[OP_DESTROY_CLIENTID] = {
 		.op_func = (nfsd4op_func)nfsd4_destroy_clientid,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-23 11:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 21:24 [PATCH] nfsd4: fix response size estimation for OP_SEQUENCE J. Bruce Fields
2014-10-21 10:36 ` Christoph Hellwig
2014-10-21 13:14   ` J. Bruce Fields
2014-10-22 19:22     ` J. Bruce Fields
2014-10-22 19:33       ` Anna Schumaker
2014-10-22 19:42       ` J. Bruce Fields
2014-10-22 20:12         ` Tom Haynes
2014-10-23  7:34           ` Christoph Hellwig
2014-10-22 19:49       ` [PATCH] nfsd4: fix crash on unknown operation number J. Bruce Fields
2014-10-23 11:54     ` [PATCH] nfsd4: fix response size estimation for OP_SEQUENCE Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox