Re: [PATCH v2 1/3] NFSD: mark cl_cb_state as NFSD4_CB_DOWN if cl_cb_client is NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 22, 2024 at 08:12:31PM -0700, Dai Ngo wrote:
> In nfsd4_run_cb_work if the rpc_clnt for the back channel is no longer
> exists, the callback state in nfs4_client should be marked as NFSD4_CB_DOWN
> so the server can notify the client to establish a new back channel
> connection.
> 
> Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx>
> ---
>  fs/nfsd/nfs4callback.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index cf87ace7a1b0..f8bb5ff2e9ac 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -1491,9 +1491,14 @@ nfsd4_run_cb_work(struct work_struct *work)
>  
>  	clnt = clp->cl_cb_client;
>  	if (!clnt) {
> -		if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags))
> +		if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) {
>  			nfsd41_destroy_cb(cb);
> -		else {
> +			clear_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags);
> +
> +			/* let client knows BC is down when it reconnects */
> +			clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags);
> +			nfsd4_mark_cb_down(clp);
> +		} else {
>  			/*
>  			 * XXX: Ideally, we could wait for the client to
>  			 *	reconnect, but I haven't figured out how

NFSD4_CLIENT_CB_KILL is for when the lease is getting expunged. It's
not supposed to be used when only the transport is closed. Thus,
shouldn't you mark_cb_down in this arm, instead? Even so, isn't the
backchannel already marked down when we get here?


-- 
Chuck Lever




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux