]> git.ipfire.org Git - thirdparty/linux.git/commit
NFS: Fix a deadlock involving nfs_release_folio()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 31 Dec 2025 16:42:31 +0000 (11:42 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 5 Jan 2026 04:03:24 +0000 (23:03 -0500)
commitcce0be6eb4971456b703aaeafd571650d314bcca
tree2d3741ca0b4b4c6e1f538534ac603da5d74834c6
parent857bf9056291a16785ae3be1d291026b2437fc48
NFS: Fix a deadlock involving nfs_release_folio()

Wang Zhaolong reports a deadlock involving NFSv4.1 state recovery
waiting on kthreadd, which is attempting to reclaim memory by calling
nfs_release_folio(). The latter cannot make progress due to state
recovery being needed.

It seems that the only safe thing to do here is to kick off a writeback
of the folio, without waiting for completion, or else kicking off an
asynchronous commit.

Reported-by: Wang Zhaolong <wangzhaolong@huaweicloud.com>
Fixes: 96780ca55e3c ("NFS: fix up nfs_release_folio() to try to release the page")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/file.c
fs/nfs/nfstrace.h
fs/nfs/write.c
include/linux/nfs_fs.h