]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
NFS: nfsiod should not block forever in mempool_alloc()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 21 Mar 2022 16:34:19 +0000 (12:34 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:27 +0000 (11:59 +0200)
commit83cd44e8d7d1c64988bd66062fad53dd43048f79
treeb8d6a1bb6feaff041634404b831ac0caaeda9edc
parentf4218774f9b0274971c50e1c1e6616cdb0337e05
NFS: nfsiod should not block forever in mempool_alloc()

BugLink: https://bugs.launchpad.net/bugs/1969107
[ Upstream commit 515dcdcd48736576c6f5c197814da6f81c60a21e ]

The concern is that since nfsiod is sometimes required to kick off a
commit, it can get locked up waiting forever in mempool_alloc() instead
of failing gracefully and leaving the commit until later.

Try to allocate from the slab first, with GFP_KERNEL | __GFP_NORETRY,
then fall back to a non-blocking attempt to allocate from the memory
pool.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit da747de6859948e75bcaaa1019ef0f7fdaf0b867)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/nfs/internal.h
fs/nfs/pnfs_nfs.c
fs/nfs/write.c
include/linux/nfs_fs.h