summaryrefslogtreecommitdiff
authorZhangXiaoxu <zhangxiaoxu5@huawei.com>2019-05-06 03:57:03 (GMT)
committer Greg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-25 16:26:47 (GMT)
commitd4b79dbdc607c22f72ba56d19b94b51175eac709 (patch)
tree367fe5dd6b8e41b2e7c7f8c7e3192e1cb1d9906f
parent48f0cdf0257228bbe748d6e0d5699bd240accb33 (diff)
downloadcommon-d4b79dbdc607c22f72ba56d19b94b51175eac709.zip
common-d4b79dbdc607c22f72ba56d19b94b51175eac709.tar.gz
common-d4b79dbdc607c22f72ba56d19b94b51175eac709.tar.bz2
NFS4: Fix v4.0 client state corruption when mount
commit f02f3755dbd14fb935d24b14650fff9ba92243b8 upstream. stat command with soft mount never return after server is stopped. When alloc a new client, the state of the client will be set to NFS4CLNT_LEASE_EXPIRED. When the server is stopped, the state manager will work, and accord the state to recover. But the state is NFS4CLNT_LEASE_EXPIRED, it will drain the slot table and lead other task to wait queue, until the client recovered. Then the stat command is hung. When discover server trunking, the client will renew the lease, but check the client state, it lead the client state corruption. So, we need to call state manager to recover it when detect server ip trunking. Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com> Cc: stable@vger.kernel.org Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat
-rw-r--r--fs/nfs/nfs4state.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 857af95..6f474b0 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -143,6 +143,10 @@ int nfs40_discover_server_trunking(struct nfs_client *clp,
/* Sustain the lease, even if it's empty. If the clientid4
* goes stale it's of no use for trunking discovery. */
nfs4_schedule_state_renewal(*result);
+
+ /* If the client state need to recover, do it. */
+ if (clp->cl_state)
+ nfs4_schedule_state_manager(clp);
}
out:
return status;