Linux NFS development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: NeilBrown <neil@brown.name>
Cc: "Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	"Pali Rohár" <pali@kernel.org>,
	"Vincent Mailhol" <mailhol.vincent@wanadoo.fr>,
	"Chuck Lever" <chuck.lever@oracle.com>,
	"Jeff Layton" <jlayton@kernel.org>,
	linux-nfs@vger.kernel.org
Subject: Re: nfslocalio: use correct wait address in nfs_uuid_put()
Date: Mon, 14 Jul 2025 10:31:41 -0400	[thread overview]
Message-ID: <aHUUzYFfNa2ecJGU@kernel.org> (raw)
In-Reply-To: <175246537302.2234665.6977010546892567896@noble.neil.brown.name>

On Mon, Jul 14, 2025 at 01:56:13PM +1000, NeilBrown wrote:
> 
> This wait_var_event_spinlock() in nfs_uuid_put() is waiting for the
> wakeup signalled at the end of nfs_close_local_fh().  That
> wake_up_var_locked() uses &nfl->nfs_uuid, so the waiter must use the
> same address, else nfs_uuid_put() could wait indefinitely causing
> various problems.
> 
> Fixes: 21fb44034695 ("nfs_localio: protect race between nfs_uuid_put() and nfs_close_local_fh()")
> Reported-by: Mike Snitzer <snitzer@kernel.org>
> Signed-off-by: NeilBrown <neil@brown.name>
> ---
>  fs/nfs_common/nfslocalio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs_common/nfslocalio.c b/fs/nfs_common/nfslocalio.c
> index 05c7c16e37ab..bc8dcfb256a3 100644
> --- a/fs/nfs_common/nfslocalio.c
> +++ b/fs/nfs_common/nfslocalio.c
> @@ -177,7 +177,7 @@ static bool nfs_uuid_put(nfs_uuid_t *nfs_uuid)
>  			/* nfs_close_local_fh() is doing the
>  			 * close and we must wait. until it unlinks
>  			 */
> -			wait_var_event_spinlock(nfl,
> +			wait_var_event_spinlock(&nfl->nfs_uuid,
>  						list_first_entry_or_null(
>  							&nfs_uuid->files,
>  							struct nfs_file_localio,
> -- 
> 2.49.0
> 
> 

Makes sense:

Acked-by: Mike Snitzer <snitzer@kernel.org>

And I _will_ try to get this tested at the scale I was able to test
late last week.  Will let you and others know (hopefully within the
next 24h).

Mike

  reply	other threads:[~2025-07-14 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14  3:56 [PATCH] nfslocalio: use correct wait address in nfs_uuid_put() NeilBrown
2025-07-14 14:31 ` Mike Snitzer [this message]
2025-07-15 16:25   ` Mike Snitzer

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=aHUUzYFfNa2ecJGU@kernel.org \
    --to=snitzer@kernel.org \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=neil@brown.name \
    --cc=pali@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