提交 b4b9a0c1 编写于 作者: V Vitaliy Gusev 提交者: Trond Myklebust

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: NVitaliy Gusev <gusev.vitaliy@nexenta.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 571b7554
...@@ -5287,6 +5287,8 @@ static int nfs4_verify_fore_channel_attrs(struct nfs41_create_session_args *args ...@@ -5287,6 +5287,8 @@ static int nfs4_verify_fore_channel_attrs(struct nfs41_create_session_args *args
return -EINVAL; return -EINVAL;
if (rcvd->max_reqs == 0) if (rcvd->max_reqs == 0)
return -EINVAL; return -EINVAL;
if (rcvd->max_reqs > NFS4_MAX_SLOT_TABLE)
rcvd->max_reqs = NFS4_MAX_SLOT_TABLE;
return 0; return 0;
} }
...@@ -5302,9 +5304,9 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args ...@@ -5302,9 +5304,9 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached) if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached)
return -EINVAL; return -EINVAL;
/* These would render the backchannel useless: */ /* These would render the backchannel useless: */
if (rcvd->max_ops == 0) if (rcvd->max_ops != sent->max_ops)
return -EINVAL; return -EINVAL;
if (rcvd->max_reqs == 0) if (rcvd->max_reqs != sent->max_reqs)
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册