NFSv4: keep state manager thread active if swap is enabled

[ Upstream commit 4dc73c679114a2f408567e2e44770ed934190db2 ]

If we are swapping over NFSv4, we may not be able to allocate memory to
start the state-manager thread at the time when we need it.
So keep it always running when swap is enabled, and just signal it to
start.

This requires updating and testing the cl_swapper count on the root
rpc_clnt after following all ->cl_parent links.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Stable-dep-of: b46d80bd2d6e ("nfs4trace: fix state manager flag printing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
NeilBrown
2022-03-07 10:41:44 +11:00
committed by Greg Kroah-Hartman
parent d601f78282
commit 6d434b4c49
6 changed files with 70 additions and 10 deletions

View File

@@ -1789,6 +1789,8 @@ struct nfs_rpc_ops {
struct nfs_server *(*create_server)(struct fs_context *);
struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
struct nfs_fattr *, rpc_authflavor_t);
void (*enable_swap)(struct inode *inode);
void (*disable_swap)(struct inode *inode);
};
/*