public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
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 1/9] NFSD: Fix infinite loop in layout state revocation
Date: Wed, 08 Apr 2026 09:58:01 -0400	[thread overview]
Message-ID: <8bfc067a3e154e53fef12215a05449d7c2678c8f.camel@kernel.org> (raw)
In-Reply-To: <20260408-umount-kills-nfsv4-state-v8-1-6e02a1d03d60@oracle.com>

On Wed, 2026-04-08 at 08:29 -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> find_one_sb_stid() skips stids whose sc_status is non-zero, but the
> SC_TYPE_LAYOUT case in nfsd4_revoke_states() never sets sc_status
> before calling nfsd4_close_layout(). The retry loop therefore finds
> the same layout stid on every iteration, hanging the revoker
> indefinitely.
> 
> Fixes: 1e33e1414bec ("nfsd: allow layout state to be admin-revoked.")
> Reported-by: Dai Ngo <dai.ngo@oracle.com>
> 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 07df4511ba23..c6cb67cf02ad 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1872,6 +1872,13 @@ void nfsd4_revoke_states(struct nfsd_net *nn, struct super_block *sb)
>  					break;
>  				case SC_TYPE_LAYOUT:
>  					ls = layoutstateid(stid);
> +					spin_lock(&clp->cl_lock);
> +					if (stid->sc_status == 0) {
> +						stid->sc_status |=
> +							SC_STATUS_ADMIN_REVOKED;
> +						atomic_inc(&clp->cl_admin_revoked);
> +					}
> +					spin_unlock(&clp->cl_lock);
>  					nfsd4_close_layout(ls);
>  					break;
>  				}

Nice catch.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2026-04-08 13:58 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 [this message]
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
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=8bfc067a3e154e53fef12215a05449d7c2678c8f.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