Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/2] Allow FREE_STATEID to free delegations
@ 2025-04-23 17:59 Benjamin Coddington
  2025-04-23 17:59 ` [PATCH 1/2] NFSv4: Ensure test_and_free_stateid callers use private memory Benjamin Coddington
  2025-04-23 17:59 ` [PATCH 2/2] NFSv4: Allow FREE_STATEID to clean up delegations Benjamin Coddington
  0 siblings, 2 replies; 10+ messages in thread
From: Benjamin Coddington @ 2025-04-23 17:59 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs

A problem observed for some clients is that the list of nfs_server->delegations can
grow unweildy, leading to the clients spinning in tight loops walking
across delegations that have been marked revoked.  These two patches attempt
to solve that problem by using the result of FREE_STATEID to clean up the
list of delegations, thus keeping that list pruned to an operable size.

There's a couple things not to like here: I don't like dropping the const
qualifier on the stateid for both the test and free operations.  The first
patch finishes the mostly complete work of ensuring we're passing a copy.
The core issue is that callers can't determine if FREE_STATEID was
successful since the operation is folded into test_and_free_stateid().
Another way would be to un-fold the call paths that are combined using
test_and_free friends, and that seems worse than just carrying result on the
stateid's type.

The second thing I don't like with this approach is that it doesn't fix the
potential problem that the client should try to make repeated attempts to free a
delegation stateid on the server that received an error from FREE_STATEID on the
first pass.  That's probably a pretty rare thing, but its also something
that can keep revoked state around forever potentially creating a
never-ending operation loop between client and server.

First pass, please criticise, thanks for any comments.

Ben

Benjamin Coddington (2):
  NFSv4: Ensure test_and_free_stateid callers use private memory
  NFSv4: Allow FREE_STATEID to clean up delegations

 fs/nfs/delegation.c  | 25 ++++++++++++++++++-------
 fs/nfs/nfs4_fs.h     |  3 +--
 fs/nfs/nfs4proc.c    | 23 ++++++++++++-----------
 include/linux/nfs4.h |  1 +
 4 files changed, 32 insertions(+), 20 deletions(-)

-- 
2.47.0


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

end of thread, other threads:[~2025-04-29 14:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 17:59 [PATCH 0/2] Allow FREE_STATEID to free delegations Benjamin Coddington
2025-04-23 17:59 ` [PATCH 1/2] NFSv4: Ensure test_and_free_stateid callers use private memory Benjamin Coddington
2025-04-23 20:35   ` Jeff Layton
2025-04-23 22:04     ` Benjamin Coddington
2025-04-29 14:01       ` Benjamin Coddington
2025-04-23 17:59 ` [PATCH 2/2] NFSv4: Allow FREE_STATEID to clean up delegations Benjamin Coddington
2025-04-23 19:41   ` Jeff Layton
2025-04-23 19:59     ` Benjamin Coddington
2025-04-23 20:37       ` Jeff Layton
2025-04-23 22:12         ` Benjamin Coddington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox