]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:13 +0000 (11:21 +0100)
commit19b4d9ab5e77843eac0429c019470c02f8710b55
treecc38ea25e68975d00ea8c619bd0193cd8a041eeb
parentd6c75aa9d607044d1e5c8498eff0259eed356c32
NFS: Fix a deadlock involving nfs_release_folio()

[ Upstream commit cce0be6eb4971456b703aaeafd571650d314bcca ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/file.c
fs/nfs/nfstrace.h
fs/nfs/write.c
include/linux/nfs_fs.h