Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfslocalio: use correct wait address in nfs_uuid_put()
@ 2025-07-14  3:56 NeilBrown
  2025-07-14 14:31 ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2025-07-14  3:56 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker
  Cc: Mike Snitzer, Pali Rohár, Vincent Mailhol, Chuck Lever,
	Jeff Layton, linux-nfs


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


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

end of thread, other threads:[~2025-07-15 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14  3:56 [PATCH] nfslocalio: use correct wait address in nfs_uuid_put() NeilBrown
2025-07-14 14:31 ` Mike Snitzer
2025-07-15 16:25   ` Mike Snitzer

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