From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v8 2/9] NFSD: Handle layout stid in nfsd4_drop_revoked_stid()
Date: Wed, 08 Apr 2026 09:59:54 -0400 [thread overview]
Message-ID: <13e27030fce8df6fcc0e3a4a7c7b07a4943d0a0e.camel@kernel.org> (raw)
In-Reply-To: <20260408-umount-kills-nfsv4-state-v8-2-6e02a1d03d60@oracle.com>
On Wed, 2026-04-08 at 08:29 -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> nfsd4_drop_revoked_stid() has no SC_TYPE_LAYOUT case, so when a
> client sends FREE_STATEID for an admin-revoked layout stid, the
> default branch releases cl_lock and returns without unhashing or
> releasing the stid. The stid remains in the IDR and on the
> per-client list until the client is destroyed.
>
> Remove the layout stid from the per-client list and call
> nfs4_put_stid() to drop the creation reference. When the
> refcount reaches zero, nfsd4_free_layout_stateid() handles the
> remaining cleanup: cancelling the fence worker, removing from
> the per-file list, and freeing the slab object.
>
> Fixes: 1e33e1414bec ("nfsd: allow layout state to be admin-revoked.")
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> fs/nfsd/nfs4state.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c6cb67cf02ad..ae5e1a20197c 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -5070,6 +5070,7 @@ static void nfsd4_drop_revoked_stid(struct nfs4_stid *s)
> {
> struct nfs4_client *cl = s->sc_client;
> LIST_HEAD(reaplist);
> + struct nfs4_layout_stateid *ls;
> struct nfs4_ol_stateid *stp;
> struct nfs4_delegation *dp;
> bool unhashed;
> @@ -5095,6 +5096,12 @@ static void nfsd4_drop_revoked_stid(struct nfs4_stid *s)
> spin_unlock(&cl->cl_lock);
> nfs4_put_stid(s);
> break;
> + case SC_TYPE_LAYOUT:
> + ls = layoutstateid(s);
> + list_del_init(&ls->ls_perclnt);
> + spin_unlock(&cl->cl_lock);
> + nfs4_put_stid(s);
> + break;
> default:
> spin_unlock(&cl->cl_lock);
> }
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2026-04-08 13:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 12:29 [PATCH v8 0/9] Automatic NFSv4 state revocation on filesystem unmount Chuck Lever
2026-04-08 12:29 ` [PATCH v8 1/9] NFSD: Fix infinite loop in layout state revocation Chuck Lever
2026-04-08 13:58 ` Jeff Layton
2026-04-08 12:29 ` [PATCH v8 2/9] NFSD: Handle layout stid in nfsd4_drop_revoked_stid() Chuck Lever
2026-04-08 13:59 ` Jeff Layton [this message]
2026-04-08 12:29 ` [PATCH v8 3/9] NFSD: Extract revoke_one_stid() utility function Chuck Lever
2026-04-08 12:29 ` [PATCH v8 4/9] NFSD: Add NFSD_CMD_UNLOCK_IP netlink command Chuck Lever
2026-04-08 12:29 ` [PATCH v8 5/9] NFSD: Add NFSD_CMD_UNLOCK_FILESYSTEM " Chuck Lever
2026-04-08 12:29 ` [PATCH v8 6/9] NFSD: Replace idr_for_each_entry_ul in find_one_sb_stid() Chuck Lever
2026-04-08 12:29 ` [PATCH v8 7/9] NFSD: Track svc_export in nfs4_stid Chuck Lever
2026-04-08 12:29 ` [PATCH v8 8/9] NFSD: Add NFSD_CMD_UNLOCK_EXPORT netlink command Chuck Lever
2026-04-08 12:29 ` [PATCH v8 9/9] NFSD: Close cached file handles when revoking export state Chuck Lever
2026-04-08 13:56 ` [PATCH v8 0/9] Automatic NFSv4 state revocation on filesystem unmount Jeff Layton
2026-04-08 13:57 ` Chuck Lever
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=13e27030fce8df6fcc0e3a4a7c7b07a4943d0a0e.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).