]> www.infradead.org Git - users/jedix/linux-maple.git/commit
NFSv4: Fix a deadlock when recovering state on a sillyrenamed file
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 1 Feb 2025 20:00:09 +0000 (15:00 -0500)
committerAnna Schumaker <anna.schumaker@oracle.com>
Wed, 19 Feb 2025 21:45:24 +0000 (16:45 -0500)
commit8f8df955f078e1a023ee55161935000a67651f38
treeadee549ebc9c6fc20627eecaff58a7c51a1c3eb8
parent5bbd6e863b15a85221e49b9bdb2d5d8f0bb91f3d
NFSv4: Fix a deadlock when recovering state on a sillyrenamed file

If the file is sillyrenamed, and slated for delete on close, it is
possible for a server reboot to triggeer an open reclaim, with can again
race with the application call to close(). When that happens, the call
to put_nfs_open_context() can trigger a synchronous delegreturn call
which deadlocks because it is not marked as privileged.

Instead, ensure that the call to nfs4_inode_return_delegation_on_close()
catches the delegreturn, and schedules it asynchronously.

Reported-by: Li Lingfeng <lilingfeng3@huawei.com>
Fixes: adb4b42d19ae ("Return the delegation when deleting sillyrenamed files")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/delegation.c
fs/nfs/delegation.h
fs/nfs/nfs4proc.c