NFSD: add courteous server support for thread with only delegation
authorDai Ngo <dai.ngo@oracle.com>
Mon, 2 May 2022 21:19:21 +0000 (14:19 -0700)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 19 May 2022 16:25:39 +0000 (12:25 -0400)
commit66af25799940b26efd41ea6e648f75c41a48a2c2
treea4e80b23a317d4dc3e758de1aabdd992167388f5
parent983084b2672c593959e3148d6a17c8b920797dde
NFSD: add courteous server support for thread with only delegation

This patch provides courteous server support for delegation only.
Only expired client with delegation but no conflict and no open
or lock state is allowed to be in COURTESY state.

Delegation conflict with COURTESY/EXPIRABLE client is resolved by
setting it to EXPIRABLE, queue work for the laundromat and return
delay to the caller. Conflict is resolved when the laudromat runs
and expires the EXIRABLE client while the NFS client retries the
OPEN request. Local thread request that gets conflict is doing the
retry in _break_lease.

Client in COURTESY or EXPIRABLE state is allowed to reconnect and
continues to have access to its state. Access to the nfs4_client by
the reconnecting thread and the laundromat is serialized via the
client_lock.

Reviewed-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c
fs/nfsd/nfsd.h
fs/nfsd/state.h