Skip to content

Commit 128a094

Browse files
committed
NFSv4.x: Fail client initialisation if state manager thread can't run
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-284.30.1.el9_2 commit-author Trond Myklebust <trond.myklebust@hammerspace.com> commit b4e4f66 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: 4697bd5 ("NFSv4: Fix a race in the net namespace mount notification") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> (cherry picked from commit b4e4f66) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 29f6174 commit 128a094

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/nfs/nfs4state.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,8 @@ void nfs4_schedule_state_manager(struct nfs_client *clp)
12321232
if (IS_ERR(task)) {
12331233
printk(KERN_ERR "%s: kthread_run: %ld\n",
12341234
__func__, PTR_ERR(task));
1235+
if (!nfs_client_init_is_complete(clp))
1236+
nfs_mark_client_ready(clp, PTR_ERR(task));
12351237
nfs4_clear_state_manager_bit(clp);
12361238
clear_bit(NFS4CLNT_MANAGER_AVAILABLE, &clp->cl_state);
12371239
nfs_put_client(clp);

0 commit comments

Comments
 (0)