Skip to contentSkip to conversation

nfsd41: use sv_max_mesg for forechannel max sizes

PATCH In review [email protected] 2 participants 2 messages Sep 24, 2009 – Sep 28, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd41: use sv_max_mesg for forechannel max sizes

From: Andy Adamson <[email protected]>

ca_maxresponsesize and ca_maxrequest size include the RPC header.

sv_max_mesg is sv_max_payolad plus a page for overhead and is used in svc_init_buffer to allocate server buffer space for both the request and reply. Note that this means we can service an RPC compound that requires ca_maxrequestsize (MAXWRITE) or ca_max_responsesize (MAXREAD) but that we do not support an RPC compound that requires both ca_maxrequestsize and ca_maxresponsesize.

---
 Documentation/filesystems/nfs41-server.txt |    3 +++
 fs/nfsd/nfs4state.c                        |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)
Documentation/filesystems/nfs41-server.txt +3 -0
index 05d81cb..6c1c4a7 100644
@@ -159,3 +159,6 @@ The following cases aren't supported yet:
   DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID.
 * DESTROY_SESSION MUST be the final operation in the COMPOUND request.
 
+CREATE_SESSION fore channel negotiation:
+* No support for a sessions fore channel RPC compound that requires both a
+  ca_maxrequestsize and a ca_maxresponsesize.
fs/nfsd/nfs4state.c +2 -1
index 46e9ac5..e9a08e5 100644
@@ -477,13 +477,14 @@ static int set_forechannel_drc_size(struct nfsd4_channel_attrs *fchan)
 
 /*
  * fchan holds the client values on input, and the server values on output
+ * sv_max_mesg is the maximum payload plus one page for overhead.
  */
 static int init_forechannel_attrs(struct svc_rqst *rqstp,
 				  struct nfsd4_channel_attrs *session_fchan,
 				  struct nfsd4_channel_attrs *fchan)
 {
 	int status = 0;
-	__u32   maxcount = svc_max_payload(rqstp);
+	__u32   maxcount = nfsd_serv->sv_max_mesg;
 
 	/* headerpadsz set to zero in encode routine */
 
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 10 lines · On Wed, Sep 23, 2009 at 09:32:21PM -0400, [email protected] wrote:

From: Andy Adamson <[email protected]>

ca_maxresponsesize and ca_maxrequest size include the RPC header.

sv_max_mesg is sv_max_payolad plus a page for overhead and is used in svc_init_buffer to allocate server buffer space for both the request and reply. Note that this means we can service an RPC compound that requires ca_maxrequestsize (MAXWRITE) or ca_max_responsesize (MAXREAD) but that we do not support an RPC compound that requires both ca_maxrequestsize and ca_maxresponsesize.

Thanks Andy, applied, as follows, with some minor documentation changes.

--b.

commit ddc04fd4d5163aee9ebdb38a56c365b602e2b7b7

Author: Andy Adamson <[email protected]>
Date:   Wed Sep 23 21:32:21 2009 -0400

nfsd41: use sv_max_mesg for forechannel max sizes

ca_maxresponsesize and ca_maxrequest size include the RPC header.

sv_max_mesg is sv_max_payolad plus a page for overhead and is used in svc_init_buffer to allocate server buffer space for both the request and reply. Note that this means we can service an RPC compound that requires ca_maxrequestsize (MAXWRITE) or ca_max_responsesize (MAXREAD) but that we do not support an RPC compound that requires both ca_maxrequestsize and ca_maxresponsesize.

[[email protected]: more documentation updates]
Documentation/filesystems/nfs41-server.txt +7 -0
index 1f95e77..1bd0d0c 100644
@@ -213,3 +213,10 @@ The following cases aren't supported yet:
   DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID.
 * DESTROY_SESSION MUST be the final operation in the COMPOUND request.
 
+Nonstandard compound limitations:
+* No support for a sessions fore channel RPC compound that requires both a
+  ca_maxrequestsize request and a ca_maxresponsesize reply, so we may
+  fail to live up to the promise we made in CREATE_SESSION fore channel
+  negotiation.
+* No more than one IO operation (read, write, readdir) allowed per
+  compound.
fs/nfsd/nfs4state.c +2 -1
index 2153f9b..fcb9817 100644
@@ -477,13 +477,14 @@ static int set_forechannel_drc_size(struct nfsd4_channel_attrs *fchan)
 
 /*
  * fchan holds the client values on input, and the server values on output
+ * sv_max_mesg is the maximum payload plus one page for overhead.
  */
 static int init_forechannel_attrs(struct svc_rqst *rqstp,
 				  struct nfsd4_channel_attrs *session_fchan,
 				  struct nfsd4_channel_attrs *fchan)
 {
 	int status = 0;
-	__u32   maxcount = svc_max_payload(rqstp);
+	__u32   maxcount = nfsd_serv->sv_max_mesg;
 
 	/* headerpadsz set to zero in encode routine */