]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Avoid changing nlink when file removes and attribute updates race
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 17 Nov 2025 20:28:17 +0000 (15:28 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:33 +0000 (14:03 +0100)
commitf0f456c327f5728ca632746cdfae0bf4f6bc5188
tree302c1a3341cd471dea592d23040a727b6003a2d2
parent530f1ba287937726ff220de9c82566e74e35dcae
NFS: Avoid changing nlink when file removes and attribute updates race

[ Upstream commit bd4928ec799b31c492eb63f9f4a0c1e0bb4bb3f7 ]

If a file removal races with another operation that updates its
attributes, then skip the change to nlink, and just mark the attributes
as being stale.

Reported-by: Aiden Lambert <alambert48@gatech.edu>
Fixes: 59a707b0d42e ("NFS: Ensure we revalidate the inode correctly after remove or rename")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/dir.c