diff options
author | 2025-08-16 07:25:20 -0700 | |
---|---|---|
committer | 2025-08-19 11:16:02 -0700 | |
commit | 76d2e3890fb169168c73f2e4f8375c7cc24a765e (patch) | |
tree | 5d23b867c67851ea8ba45cbbd2ad1a85b74e3cc0 /tools/perf/scripts/python | |
parent | Linux 6.17-rc2 (diff) | |
download | wireguard-linux-76d2e3890fb169168c73f2e4f8375c7cc24a765e.tar.xz wireguard-linux-76d2e3890fb169168c73f2e4f8375c7cc24a765e.zip |
NFS: Fix a race when updating an existing write
After nfs_lock_and_join_requests() tests for whether the request is
still attached to the mapping, nothing prevents a call to
nfs_inode_remove_request() from succeeding until we actually lock the
page group.
The reason is that whoever called nfs_inode_remove_request() doesn't
necessarily have a lock on the page group head.
So in order to avoid races, let's take the page group lock earlier in
nfs_lock_and_join_requests(), and hold it across the removal of the
request in nfs_inode_remove_request().
Reported-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Joe Quanaim <jdq@meta.com>
Tested-by: Andrew Steffen <aksteffen@meta.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Fixes: bd37d6fce184 ("NFSv4: Convert nfs_lock_and_join_requests() to use nfs_page_find_head_request()")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions