NFSv4: Allow FREE_STATEID to clean up delegations

JIRA: https://issues.redhat.com/browse/RHEL-70625

commit 77be29b7a3f896bd96808ba6781481a1f6afa66c
Author: Benjamin Coddington bcodding@redhat.com
Date: Thu May 1 08:29:42 2025 -0400

NFSv4: Allow FREE_STATEID to clean up delegations

The NFS client's list of delegations can grow quite large (well beyond the
delegation watermark) if the server is revoking or there are repeated
events that expire state.  Once this happens, the revoked delegations can
cause a performance problem for subsequent walks of the
servers->delegations list when the client tries to test and free state.

If we can determine that the FREE_STATEID operation has completed without
error, we can prune the delegation from the list.

Since the NFS client combines TEST_STATEID with FREE_STATEID in its minor
version operations, there isn't an easy way to communicate success of
FREE_STATEID.  Rather than re-arrange quite a number of calling paths to
break out the separate procedures, let's signal the success of FREE_STATEID
by setting the stateid's type.

Set NFS4_FREED_STATEID_TYPE for stateids that have been successfully
discarded from the server, and use that type to signal that the delegation
can be cleaned up.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

Signed-off-by: Benjamin Coddington bcodding@redhat.com

Merge request reports

Loading