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)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Mar 2022 19:52:56 +0000 (15:52 -0400)
commit515dcdcd48736576c6f5c197814da6f81c60a21e
tree1e60066cbf650cf06a95386681744d867490156b
parentb2648015d4521de21ed3c9f48f718e023860b8c1
NFS: nfsiod should not block forever in mempool_alloc()

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>
fs/nfs/internal.h
fs/nfs/pnfs_nfs.c
fs/nfs/write.c
include/linux/nfs_fs.h