On Jun 24, 2009, at 12:37 PM, Adamson, Andy wrote:
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;
Here we set the maxresp_cached equal to 512 which is normally much
less than the maxresp_sz, and we return this value to client in
CREATE_SESSION.
This leads to a bunch of NFSERR_TOO_BIG_TO_CACHE errors for OPENs,
READs, etc.
In theory the client should be able to recover (or better prevent this
by not setting cachethis=1).
Is there a reason that maxresp_cached is so small ?
-alexandros
/* Use the client's maxops if possible */
--
1.5.4.3
_______________________________________________
pNFS mailing list
pNFS@xxxxxxxxxxxxx
http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
--
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