提交 7a3e3e18 编写于 作者: T Trond Myklebust

NFS: Ensure that we respect NFS_MAX_TCP_TIMEOUT

It isn't sufficient just to limit timeout->to_initval, we also need to
limit to_maxval.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 ba7392bb
...@@ -387,12 +387,16 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto, ...@@ -387,12 +387,16 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
switch (proto) { switch (proto) {
case XPRT_TRANSPORT_TCP: case XPRT_TRANSPORT_TCP:
case XPRT_TRANSPORT_RDMA: case XPRT_TRANSPORT_RDMA:
if (!to->to_initval) if (to->to_initval == 0)
to->to_initval = 60 * HZ; to->to_initval = 60 * HZ;
if (to->to_initval > NFS_MAX_TCP_TIMEOUT) if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
to->to_initval = NFS_MAX_TCP_TIMEOUT; to->to_initval = NFS_MAX_TCP_TIMEOUT;
to->to_increment = to->to_initval; to->to_increment = to->to_initval;
to->to_maxval = to->to_initval + (to->to_increment * to->to_retries); to->to_maxval = to->to_initval + (to->to_increment * to->to_retries);
if (to->to_maxval > NFS_MAX_TCP_TIMEOUT)
to->to_maxval = NFS_MAX_TCP_TIMEOUT;
if (to->to_maxval < to->to_initval)
to->to_maxval = to->to_initval;
to->to_exponential = 0; to->to_exponential = 0;
break; break;
case XPRT_TRANSPORT_UDP: case XPRT_TRANSPORT_UDP:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册