summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2022-12-06 12:42:59 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 11:30:15 +0100
commit732990cc7b170e40c47ae07c82e21565a503460e (patch)
treef5a9f15e093e3a2615f608bfe678fca096ee50fc /fs
parent1f356afe521dd4d92b636761df098c068800093d (diff)
downloadlinux-stable-732990cc7b170e40c47ae07c82e21565a503460e.tar.gz
linux-stable-732990cc7b170e40c47ae07c82e21565a503460e.tar.bz2
linux-stable-732990cc7b170e40c47ae07c82e21565a503460e.zip
NFSv4.x: Fail client initialisation if state manager thread can't run
[ Upstream commit b4e4f66901658fae0614dea5bf91062a5387eda7 ] If the state manager thread fails to start, then we should just mark the client initialisation as failed so that other processes or threads don't get stuck in nfs_wait_client_init_complete(). Reported-by: ChenXiaoSong <chenxiaosong2@huawei.com> Fixes: 4697bd5e9419 ("NFSv4: Fix a race in the net namespace mount notification") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4state.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 5ab021f87ecf..b9fbd01ef4cf 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1247,6 +1247,8 @@ void nfs4_schedule_state_manager(struct nfs_client *clp)
if (IS_ERR(task)) {
printk(KERN_ERR "%s: kthread_run: %ld\n",
__func__, PTR_ERR(task));
+ if (!nfs_client_init_is_complete(clp))
+ nfs_mark_client_ready(clp, PTR_ERR(task));
nfs4_clear_state_manager_bit(clp);
nfs_put_client(clp);
module_put(THIS_MODULE);