Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 14D1B4229C6; Tue, 21 Jul 2026 20:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664015; cv=none; b=nlYZ+7uZ5pyTNJH0YPkqPUcUxqAPMaWaGb55ChHw3tMdl4vBGPBtbMLYgdHh/P8Ufv04IDtMyiwZ00zqinKgR7xnHQuCUrQnVZMOHcbTqoGPvbjxRaKGVbVWuhfa324UyvdpTZbA8CDkNL4QiG803522kgIsaZhmer/4purfBj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664015; c=relaxed/simple; bh=L9roLUsqp5oY8hXLbjdhb/gFD/N1Bv3wJqi582mB2bQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FJL9DYu5SEuRLIAPelHp0WXZIcOIRtiYV47cEy9D4EfuRT+IwstTsujUeZCsiq0vIVk4ZeXFehxLIhefYaPzbc3d65bCp9MYaUAuCKxfOp2hNfBxSH08yRQfDy5TIo5/J24nzhcjXjnhkdggywgdbNL/0nTnAR/ufplaTJUNHPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EppUG7Gj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EppUG7Gj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7ABCB1F000E9; Tue, 21 Jul 2026 20:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784664014; bh=pzkDjQm+i5tQ5yc1kcsaQbsD7uUAoHLlnVNjG5RRNN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EppUG7Gj2dAlgDavZmDbZJwPTms8JMdD7elfY7m63S2zbq22V9cybYzdLsu9euhbw Oibx4SOcmTzG56QKpYpSxis1bcNYt2GwDnNDG0elQSkDvePOyekibdsOPsdRaushJU M8Q92iiYIgTOHGvqzbf5lk/hD7vB5L93GWzwFrEM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bradley Morgan , Thomas Gleixner Subject: [PATCH 6.12 1040/1276] cpu: hotplug: Preserve per instance callback errors Date: Tue, 21 Jul 2026 17:24:43 +0200 Message-ID: <20260721152509.260002627@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@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: Bradley Morgan commit 673db10729fb121ea1b16fe57791a0cb9eac1eb5 upstream. cpuhp_invoke_callback() unwinds earlier callbacks for the same hotplug state when one instance fails. The rollback path currently reuses ret, so a successful rollback can hide the original error and make the failed transition look successful. Keep the rollback result separate from the original error. Fixes: 724a86881d03 ("smp/hotplug: Callback vs state-machine consistency") Signed-off-by: Bradley Morgan Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260619163719.12103-1-include@grrlz.net Signed-off-by: Greg Kroah-Hartman --- kernel/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -174,7 +174,7 @@ static int cpuhp_invoke_callback(unsigne struct cpuhp_step *step = cpuhp_get_step(state); int (*cbm)(unsigned int cpu, struct hlist_node *node); int (*cb)(unsigned int cpu); - int ret, cnt; + int ret, cnt, rollback_ret; if (st->fail == state) { st->fail = CPUHP_INVALID; @@ -238,12 +238,12 @@ err: break; trace_cpuhp_multi_enter(cpu, st->target, state, cbm, node); - ret = cbm(cpu, node); - trace_cpuhp_exit(cpu, st->state, state, ret); + rollback_ret = cbm(cpu, node); + trace_cpuhp_exit(cpu, st->state, state, rollback_ret); /* * Rollback must not fail, */ - WARN_ON_ONCE(ret); + WARN_ON_ONCE(rollback_ret); } return ret; }