NFSv4: Protect the state recovery thread against direct reclaim
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 29 Jan 2022 18:32:45 +0000 (13:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:12 +0000 (20:59 +0200)
commita34752aa23975196fb38c5caf98485f258eef3eb
tree0d9b14dda965e8e6e32914f3709410208e283518
parentb37f482ba9f0e6382c188e3fccf6c4b2fdc938eb
NFSv4: Protect the state recovery thread against direct reclaim

[ Upstream commit 3e17898aca293a24dae757a440a50aa63ca29671 ]

If memory allocation triggers a direct reclaim from the state recovery
thread, then we can deadlock. Use memalloc_nofs_save/restore to ensure
that doesn't happen.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4state.c