Linux NFS development
 help / color / mirror / Atom feed
From: Benjamin Coddington <bcodding@redhat.com>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 0/2] Allow FREE_STATEID to free delegations
Date: Wed, 23 Apr 2025 13:59:39 -0400	[thread overview]
Message-ID: <cover.1745430006.git.bcodding@redhat.com> (raw)

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


             reply	other threads:[~2025-04-23 17:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 17:59 Benjamin Coddington [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1745430006.git.bcodding@redhat.com \
    --to=bcodding@redhat.com \
    --cc=anna@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox