]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFS/localio: nfs_uuid_put() fix races with nfs_open/close_local_fh()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 15 Jul 2025 19:49:00 +0000 (12:49 -0700)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 5 Aug 2025 23:45:40 +0000 (16:45 -0700)
commitfdd015de767977f21892329af5e12276eb80375f
treead69d55fe185710272fad4dd21142d12aaa1abd5
parente144d53cf21fb9d02626c669533788c6bdc61ce3
NFS/localio: nfs_uuid_put() fix races with nfs_open/close_local_fh()

In order for the wait in nfs_uuid_put() to be safe, it is necessary to
ensure that nfs_uuid_add_file() doesn't add a new entry once the
nfs_uuid->net has been NULLed out.

Also fix up the wake_up_var_locked() / wait_var_event_spinlock() to both
use the nfs_uuid address, since nfl, and &nfl->uuid could be used elsewhere.

Acked-by: Mike Snitzer <snitzer@kernel.org>
Tested-by: Mike Snitzer <snitzer@kernel.org>
Link: https://lore.kernel.org/all/175262893035.2234665.1735173020338594784@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