NFS: Fix a typo in nfs_init_timeout_values()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 21 Mar 2019 21:57:56 +0000 (17:57 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 23 Mar 2019 16:03:58 +0000 (12:03 -0400)
Specifying a retrans=0 mount parameter to a NFS/TCP mount, is
inadvertently causing the NFS client to rewrite any specified
timeout parameter to the default of 60 seconds.

Fixes: a956beda19a6 ("NFS: Allow the mount option retrans=0")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/client.c

index fb1cf1a4bda2a105e60cb23d95dea4b3abc09f70..90d71fda65cecfb3958cc4391240e2a09bac783e 100644 (file)
@@ -453,7 +453,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
        case XPRT_TRANSPORT_RDMA:
                if (retrans == NFS_UNSPEC_RETRANS)
                        to->to_retries = NFS_DEF_TCP_RETRANS;
-               if (timeo == NFS_UNSPEC_TIMEO || to->to_retries == 0)
+               if (timeo == NFS_UNSPEC_TIMEO || to->to_initval == 0)
                        to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10;
                if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
                        to->to_initval = NFS_MAX_TCP_TIMEOUT;