aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaliy Gusev <gusev.vitaliy@gmail.com>2012-02-15 10:38:25 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-15 11:16:11 -0500
commitb4b9a0c1c89464dabafef974960f509ce33ae1c0 (patch)
tree54b90f1c3f403db513bebe3bf1e7fdddc202515e
parent571b7554016941ef0f0c3c61be72561e2bc55f5e (diff)
nfs41: Verify channel's attributes accordingly to RFC v2
ca_maxoperations: For the backchannel, the server MUST NOT change the value the client offers. For the fore channel, the server MAY change the requested value. ca_maxrequests: For the backchannel, the server MUST NOT change the value the client offers. For the fore channel, the server MAY change the requested value. Signed-off-by: Vitaliy Gusev <gusev.vitaliy@nexenta.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 0b3316541734..87c584dd88b1 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5287,6 +5287,8 @@ static int nfs4_verify_fore_channel_attrs(struct nfs41_create_session_args *args
5287 return -EINVAL; 5287 return -EINVAL;
5288 if (rcvd->max_reqs == 0) 5288 if (rcvd->max_reqs == 0)
5289 return -EINVAL; 5289 return -EINVAL;
5290 if (rcvd->max_reqs > NFS4_MAX_SLOT_TABLE)
5291 rcvd->max_reqs = NFS4_MAX_SLOT_TABLE;
5290 return 0; 5292 return 0;
5291} 5293}
5292 5294
@@ -5302,9 +5304,9 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
5302 if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached) 5304 if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached)
5303 return -EINVAL; 5305 return -EINVAL;
5304 /* These would render the backchannel useless: */ 5306 /* These would render the backchannel useless: */
5305 if (rcvd->max_ops == 0) 5307 if (rcvd->max_ops != sent->max_ops)
5306 return -EINVAL; 5308 return -EINVAL;
5307 if (rcvd->max_reqs == 0) 5309 if (rcvd->max_reqs != sent->max_reqs)
5308 return -EINVAL; 5310 return -EINVAL;
5309 return 0; 5311 return 0;
5310} 5312}