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 50A0919DF8C; Thu, 15 Aug 2024 14:15:16 +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=1723731316; cv=none; b=Flo02Qhwf+ukxxRDFjxmq05oLxBskPE2DUfOA1+oCIUtioP/rX9dATjWgQurRonSJnSn0o8/OP4lEAkCBdhStxXv87He4zbYVybio6U/W84916y3u8r2mOt8Ju8WtszI/EaKyXNmZ88CO5VpFCgzkXzcgam7jA7+MGCN58FDmRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723731316; c=relaxed/simple; bh=8g5I7tvQnVDlX3XMnwiy/7kocWIv/7Wz2wjT8504tqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O+msB/FA0v4+dlLYqa6r5N9v1mMLY7RLWe+mVwow3qUMvM8AFBbtCvRQfKWFhE/aYl+H0lninARRz8OtuWU9SyzIhr7YvQlkRFewLXt99X5fc7E8/lGsMsH5HhSCyS00IvAeYoXTjaZcw9idqJD9JJuV8k02zjI9UwHnMDz3rFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XdCeDP/6; 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="XdCeDP/6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4ED86C4AF0A; Thu, 15 Aug 2024 14:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723731316; bh=8g5I7tvQnVDlX3XMnwiy/7kocWIv/7Wz2wjT8504tqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XdCeDP/6+nmbQT8Ql8vpMxnyDqMes2LPmSIMr8FqUJUlpZX7oU9TIGO3TJ+Kc+oSP jbdGPRTQHLXlQJDFaAdJO12uev5921ivANB0rzStc0d2lc/S7c0ow6nfg6U5hsu3yD smrX236MSe9JK4m2fIowTKqIVOVqIckNEJrBrJfc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, NeilBrown , Anna Schumaker , Sasha Levin Subject: [PATCH 5.4 063/259] SUNRPC: avoid soft lockup when transmitting UDP to reachable server. Date: Thu, 15 Aug 2024 15:23:16 +0200 Message-ID: <20240815131905.240495298@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240815131902.779125794@linuxfoundation.org> References: <20240815131902.779125794@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: NeilBrown [ Upstream commit 6258cf25d5e3155c3219ab5a79b970eef7996356 ] Prior to the commit identified below, call_transmit_status() would handle -EPERM and other errors related to an unreachable server by falling through to call_status() which added a 3-second delay and handled the failure as a timeout. Since that commit, call_transmit_status() falls through to handle_bind(). For UDP this moves straight on to handle_connect() and handle_transmit() so we immediately retransmit - and likely get the same error. This results in an indefinite loop in __rpc_execute() which triggers a soft-lockup warning. For the errors that indicate an unreachable server, call_transmit_status() should fall back to call_status() as it did before. This cannot cause the thundering herd that the previous patch was avoiding, as the call_status() will insert a delay. Fixes: ed7dc973bd91 ("SUNRPC: Prevent thundering herd when the socket is not connected") Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- net/sunrpc/clnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 2e08876bf8564..f689c7b0c304d 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2236,12 +2236,13 @@ call_transmit_status(struct rpc_task *task) task->tk_action = call_transmit; task->tk_status = 0; break; - case -ECONNREFUSED: case -EHOSTDOWN: case -ENETDOWN: case -EHOSTUNREACH: case -ENETUNREACH: case -EPERM: + break; + case -ECONNREFUSED: if (RPC_IS_SOFTCONN(task)) { if (!task->tk_msg.rpc_proc->p_proc) trace_xprt_ping(task->tk_xprt, -- 2.43.0