[PATCH 4/5] nfsd41: set the session maximum response size cached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

NFSD_SLOT_CACHE_SIZE holds the encoded operations past the SEQUENCE operation.
ca_maxresponsesize_cached (draft-ietf-nfsv4-minorversion1-29) is the xdr
encoded size of the request including the RPC header. Since the RPC header
size varies with security flavor credential and verifier. we cannot set an
accurate ca_maxresponsesize_cached. Use NFSD_SLOT_CACHE_SIZE as an
approximate ca_maxresponsesize_cached - we will have at least that much space.

Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
---
 fs/nfsd/nfs4state.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 991c3cc..a0bd6da 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -464,9 +464,14 @@ static int init_forechannel_attrs(struct svc_rqst *rqstp,
 		fchan->maxresp_sz = maxcount;
 	session_fchan->maxresp_sz = fchan->maxresp_sz;
 
-	/* Set the max response cached size our default which is
-	 * a multiple of PAGE_SIZE and small */
-	session_fchan->maxresp_cached = NFSD_PAGES_PER_SLOT * PAGE_SIZE;
+	/*
+	 * The ca_maxresponssize_cached definition includes the xdr
+	 * encoded size of the rpc header with the variable length security
+	 * flavor credential plus verifier as well as the encoded SEQUENCE
+	 * operation response size which are not included in
+	 * NFSD_SLOT_CACHE_SIZE. We err on the side of being a bit small.
+	 */
+	session_fchan->maxresp_cached = NFSD_SLOT_CACHE_SIZE;
 	fchan->maxresp_cached = session_fchan->maxresp_cached;
 
 	/* Use the client's maxops if possible */
-- 
1.5.4.3

--
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

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux