]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFS/localio: nfs_uuid_put() fix the wake up after unlinking the file
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 15 Jul 2025 18:29:51 +0000 (11:29 -0700)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 5 Aug 2025 23:45:40 +0000 (16:45 -0700)
Use store_release_wake_up() instead of wake_up_var_locked(), because the
waiter cannot retake the nfs_uuid->lock.

Acked-by: Mike Snitzer <snitzer@kernel.org>
Tested-by: Mike Snitzer <snitzer@kernel.org>
Suggested-by: NeilBrown <neil@brown.name>
Link: https://lore.kernel.org/all/175262948827.2234665.1891349021754495573@noble.neil.brown.name/
Fixes: 21fb44034695 ("nfs_localio: protect race between nfs_uuid_put() and nfs_close_local_fh()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs_common/nfslocalio.c

index f1f1592ac13487e40e91e8d3ddb7918e29a0b41e..dd715cdb6c04310add1f7f1fcdc5e0b9554f8a76 100644 (file)
@@ -198,8 +198,7 @@ static bool nfs_uuid_put(nfs_uuid_t *nfs_uuid)
                /* Now we can allow racing nfs_close_local_fh() to
                 * skip the locking.
                 */
-               RCU_INIT_POINTER(nfl->nfs_uuid, NULL);
-               wake_up_var_locked(&nfl->nfs_uuid, &nfs_uuid->lock);
+               store_release_wake_up(&nfl->nfs_uuid, RCU_INITIALIZER(NULL));
        }
 
        /* Remove client from nn->local_clients */