Re: [PATCH RFC v18 02/11] NFSD: Add courtesy client state, macro and spinlock to support courteous server

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

 




On 3/29/22 1:01 PM, Bruce Fields wrote:
On Tue, Mar 29, 2022 at 07:58:46PM +0000, Chuck Lever III wrote:
Got it. Agreed, cl_cs_client_state should be reinitialized if
a courtesy client is transitioned back to "active".

Dai, would you add

+enum courtesy_client_state {
	NFSD4_CLIENT_ACTIVE = 0,
+	NFSD4_CLIENT_COURTESY,
+	NFSD4_CLIENT_EXPIRED,
+	NFSD4_CLIENT_RECONNECTED,
+};

And set cl_cs_client_state to ACTIVE where the client is
allowed to transition back to being active?

fix in v19.

I'm not clear then what the RECONNECTED->ACTIVE transition would be.

My feeling is that the RECONNECTED state shouldn't exist, and that there
should only be a transition of EXPIRED back to ACTIVE.

For the client to be truly active we need to create the client record.
We do not want to create the client record when we just detect that
the client reconnects because not all the callers want the client to
be active, we leave it for the callers to decide. Also some callers of
nfsd4_courtesy_clnt_expired hold the nn->client_lock so we can create
the client record there.

Leaving the NFSD4_CLIENT_RECONNECTED state set does not really
cause any functional problem since the RECONNECT state is meant
to used temporary within the context of the same request. But
I will reset the state back to NFSD4_CLIENT_ACTIVE for clarity.


-Dai


--b.



[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