From: Trond Myklebust Date: Tue, 6 Dec 2022 17:42:59 +0000 (-0500) Subject: NFSv4.x: Fail client initialisation if state manager thread can't run X-Git-Tag: v5.15.92~1178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0de70ed675fab2d02093647932d0aef40b6c2612;p=platform%2Fkernel%2Flinux-rpi.git 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 Fixes: 4697bd5e9419 ("NFSv4: Fix a race in the net namespace mount notification") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index ecac56b..0cd803b 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1227,6 +1227,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);