diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2025-07-15 12:43:41 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 12:17:01 +0200 |
commit | 61d1cdf66957a9adb194b1d22a1d22cd93c740fc (patch) | |
tree | d009f5374c13304315c4156b3b03956951563e44 | |
parent | fc3abba57decaabc918dd7865e193351ab770455 (diff) |
NFS/localio: nfs_close_local_fh() fix check for file closed
[ Upstream commit e144d53cf21fb9d02626c669533788c6bdc61ce3 ]
If the struct nfs_file_localio is closed, its list entry will be empty,
but the nfs_uuid->files list might still contain other entries.
Acked-by: Mike Snitzer <snitzer@kernel.org>
Tested-by: Mike Snitzer <snitzer@kernel.org>
Reviewed-by: NeilBrown <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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/nfs_common/nfslocalio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs_common/nfslocalio.c b/fs/nfs_common/nfslocalio.c index 05c7c16e37ab..64949c46c174 100644 --- a/fs/nfs_common/nfslocalio.c +++ b/fs/nfs_common/nfslocalio.c @@ -314,7 +314,7 @@ void nfs_close_local_fh(struct nfs_file_localio *nfl) rcu_read_unlock(); return; } - if (list_empty(&nfs_uuid->files)) { + if (list_empty(&nfl->list)) { /* nfs_uuid_put() has started closing files, wait for it * to finished */ |