Skip to contentSkip to conversation

nfs41: make sure nfs server return right ca_maxresponsesize_cached

PATCH In review Mi Jinlong 2 participants 3 messages Mar 10, 2011 – Mar 18, 2011

Subsystems (2)
lore
Share & tools
lore

Mi Jinlong

author
#0 lore raw

PATCH 1/1 nfs41: make sure nfs server return right ca_maxresponsesize_cached

According to rfc5661,

ca_maxresponsesize_cached:

Like ca_maxresponsesize, but the maximum size of a reply that will be stored in the reply cache (Section 2.10.6.1). For each channel, the server MAY decrease this value, but MUST NOT increase it.

the latest kernel(2.6.38-rc8) may increase the value for ignoring request's ca_maxresponsesize_cached value. We should not ignore it.

---
 fs/nfsd/nfs4state.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +2 -1
index 54b60bf..96edd02 100644
@@ -608,7 +608,8 @@ static void init_forechannel_attrs(struct nfsd4_channel_attrs *new, struct nfsd4
 	u32 maxrpc = nfsd_serv->sv_max_mesg;
 
 	new->maxreqs = numslots;
-	new->maxresp_cached = slotsize + NFSD_MIN_HDR_SEQ_SZ;
+	new->maxresp_cached = min_t(u32, req->maxresp_cached, 
+					slotsize + NFSD_MIN_HDR_SEQ_SZ);
 	new->maxreq_sz = min_t(u32, req->maxreq_sz, maxrpc);
 	new->maxresp_sz = min_t(u32, req->maxresp_sz, maxrpc);
 	new->maxops = min_t(u32, req->maxops, NFSD_MAX_OPS_PER_COMPOUND);
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 8 lines · Mi Jinlong

According to rfc5661,

ca_maxresponsesize_cached:

Like ca_maxresponsesize, but the maximum size of a reply that will be stored in the reply cache (Section 2.10.6.1). For each channel, the server MAY decrease this value, but MUST NOT increase it.

I wonder what the reason for that is--I can't see why the client would object to the server increasing this. Oh well, my as well observe the MUST NOT; applied.

--b.

Quoted 28 lines

the latest kernel(2.6.38-rc8) may increase the value for ignoring request's ca_maxresponsesize_cached value. We should not ignore it.

---
 fs/nfsd/nfs4state.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +2 -1
index 54b60bf..96edd02 100644
@@ -608,7 +608,8 @@ static void init_forechannel_attrs(struct nfsd4_channel_attrs *new, struct nfsd4
 	u32 maxrpc = nfsd_serv->sv_max_mesg;
 
 	new->maxreqs = numslots;
-	new->maxresp_cached = slotsize + NFSD_MIN_HDR_SEQ_SZ;
+	new->maxresp_cached = min_t(u32, req->maxresp_cached, 
+					slotsize + NFSD_MIN_HDR_SEQ_SZ);
 	new->maxreq_sz = min_t(u32, req->maxreq_sz, maxrpc);
 	new->maxresp_sz = min_t(u32, req->maxresp_sz, maxrpc);
 	new->maxops = min_t(u32, req->maxops, NFSD_MAX_OPS_PER_COMPOUND);
Signature · 1 line
1.7.4.1
author
#2 lore raw

J. Bruce Fields:

Quoted 5 lines · Mi Jinlong
Quoted 4 lines

According to rfc5661,

ca_maxresponsesize_cached:

Quoted 8 lines
Quoted 4 lines

Like ca_maxresponsesize, but the maximum size of a reply that will be stored in the reply cache (Section 2.10.6.1). For each channel, the server MAY decrease this value, but MUST NOT increase it.

I wonder what the reason for that is--I can't see why the client would object to the server increasing this. Oh well, my as well observe the MUST NOT; applied.

I just read the RFC and got it.

Agree with you.

--
thanks,
Mi Jinlong

Quoted 31 lines

--b.

Quoted 28 lines

the latest kernel(2.6.38-rc8) may increase the value for ignoring request's ca_maxresponsesize_cached value. We should not ignore it.

---
 fs/nfsd/nfs4state.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +2 -1
index 54b60bf..96edd02 100644
@@ -608,7 +608,8 @@ static void init_forechannel_attrs(struct nfsd4_channel_attrs *new, struct nfsd4
 	u32 maxrpc = nfsd_serv->sv_max_mesg;
 
 	new->maxreqs = numslots;
-	new->maxresp_cached = slotsize + NFSD_MIN_HDR_SEQ_SZ;
+	new->maxresp_cached = min_t(u32, req->maxresp_cached, 
+					slotsize + NFSD_MIN_HDR_SEQ_SZ);
 	new->maxreq_sz = min_t(u32, req->maxreq_sz, maxrpc);
 	new->maxresp_sz = min_t(u32, req->maxresp_sz, maxrpc);
 	new->maxops = min_t(u32, req->maxops, NFSD_MAX_OPS_PER_COMPOUND);
Signature · 1 line
1.7.4.1