Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] NFS4: Fix v4.0 client state corruption when mount
@ 2019-05-06  3:57 ZhangXiaoxu
  2019-05-13  1:48 ` zhangxiaoxu (A)
  0 siblings, 1 reply; 2+ messages in thread
From: ZhangXiaoxu @ 2019-05-06  3:57 UTC (permalink / raw)
  To: trond.myklebust, nna.schumaker, linux-nfs, zhangxiaoxu5

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>
---
 fs/nfs/nfs4state.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 3de3647..f502f1c 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -159,6 +159,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;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] NFS4: Fix v4.0 client state corruption when mount
  2019-05-06  3:57 [PATCH] NFS4: Fix v4.0 client state corruption when mount ZhangXiaoxu
@ 2019-05-13  1:48 ` zhangxiaoxu (A)
  0 siblings, 0 replies; 2+ messages in thread
From: zhangxiaoxu (A) @ 2019-05-13  1:48 UTC (permalink / raw)
  To: trond.myklebust, nna.schumaker, linux-nfs

ping.

On 5/6/2019 11:57 AM, ZhangXiaoxu wrote:
> 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>
> ---
>   fs/nfs/nfs4state.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 3de3647..f502f1c 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -159,6 +159,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;
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06  3:57 [PATCH] NFS4: Fix v4.0 client state corruption when mount ZhangXiaoxu
2019-05-13  1:48 ` zhangxiaoxu (A)

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox