]> 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:18:36 +0000 (11:18 +0100)
commit49d352bc263fe4a834233338bfaad31b3109addf
tree66018c4d22830bc70dfb691b5172471ae0f247ab
parenta316fd9d3065b753b03d802530004aea481512cc
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