]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4.1: fix mount hang after CREATE_SESSION failure
authorAnthony Iliopoulos <ailiop@suse.com>
Wed, 13 Aug 2025 09:00:47 +0000 (11:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:13 +0000 (12:45 +0100)
[ Upstream commit bf75ad096820fee5da40e671ebb32de725a1c417 ]

When client initialization goes through server trunking discovery, it
schedules the state manager and then sleeps waiting for nfs_client
initialization completion.

The state manager can fail during state recovery, and specifically in
lease establishment as nfs41_init_clientid() will bail out in case of
errors returned from nfs4_proc_create_session(), without ever marking
the client ready. The session creation can fail for a variety of reasons
e.g. during backchannel parameter negotiation, with status -EINVAL.

The error status will propagate all the way to the nfs4_state_manager
but the client status will not be marked, and thus the mount process
will remain blocked waiting.

Fix it by adding -EINVAL error handling to nfs4_state_manager().

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4state.c

index b64a3751c3e4a731b607ab6d3a840d43e1bf6067..49defb02cc201d87c0f601acc0d3eb93703799a6 100644 (file)
@@ -2660,6 +2660,9 @@ out_error:
        case -ENETUNREACH:
                nfs_mark_client_ready(clp, -EIO);
                break;
+       case -EINVAL:
+               nfs_mark_client_ready(clp, status);
+               break;
        default:
                ssleep(1);
                break;