From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33498346E7E; Tue, 11 Nov 2025 01:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762824245; cv=none; b=RtM0qlNMssPG2O7h+cT+XDdd0N6Je0BqdMH3PZRKYPZ9M3W+WXIshbr03JI6+nUXM+La5MUdIL3k54m9nDfZl7Tf7rtJ3TjaWHf7QkwKnl+XMmeMqzQ7I/Lux8tEFVC/ie0R6XGnW3n4Ey0Ssapo2Hv4ZBERyw8sWMRSNihtjcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762824245; c=relaxed/simple; bh=aD6nOUXAv9du+j8BzP0SzMt5UDNvC/P0VRuvCp5gIzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RBAoUFxmAiC5jQPWD59fGixkUuZ+slq4APR01wTneLnMEXwUXMlKHY15E7j7Ch8zzwmata3nRBS5PiYHMFIsp1Bmj3qnFqcq8wpc8Y2zzVR8V+BEdTeTKAs+bBe5NCB6ZcOjx0I0bvYeqYE0EemE6dgKWMCNnUzqlMdDOlEFSa4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oW2Ga4C/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oW2Ga4C/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C034EC4CEFB; Tue, 11 Nov 2025 01:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762824245; bh=aD6nOUXAv9du+j8BzP0SzMt5UDNvC/P0VRuvCp5gIzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oW2Ga4C/gkOLG3b9vnBeyIDnKcBS+DMVYSOcOZzRQ2U6U8qQ8M0o2MmSDtJ4ULpTs hWCXHMJ/QgVGrOSpJkD0AoJeEvaReW52s35LCxWBTztbTfwmnQcxcudcb7EOwC29Bj q47Vf9A05XfAHZuhaRQwvrggngFXS7Z/1d8Bh+xQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anthony Iliopoulos , Anna Schumaker , Sasha Levin Subject: [PATCH 6.12 418/565] NFSv4.1: fix mount hang after CREATE_SESSION failure Date: Tue, 11 Nov 2025 09:44:34 +0900 Message-ID: <20251111004536.265970722@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004526.816196597@linuxfoundation.org> References: <20251111004526.816196597@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anthony Iliopoulos [ 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 Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 397a86011878f..946acdeaf85ad 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -2745,6 +2745,9 @@ static void nfs4_state_manager(struct nfs_client *clp) case -ENETUNREACH: nfs_mark_client_ready(clp, -EIO); break; + case -EINVAL: + nfs_mark_client_ready(clp, status); + break; default: ssleep(1); break; -- 2.51.0