From mboxrd@z Thu Jan 1 00:00:00 1970 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 694F4350A05; Sat, 30 May 2026 17:16: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=1780161375; cv=none; b=ZXwjbVTCRVsMBlb5GX6C3ceCZsa8I+7Ir/6w172PxlEC5rJAf5FP5Hty5pGxLHnW8qSW3WDRuDSjVj+Op7zp31/5pXhRAfUVFvgkySqTUKmQA0cx+90NpFg6STngRkweA0EY3Z7DPaV4J3e2qjZQ/Aek9LUt7dI0U5LijydSBDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780161375; c=relaxed/simple; bh=5F1GJcDDMf1DDpe+EjyGhWm43LtippPszM+Jj+ocYXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CPL5XqU5C2lnON8tMckM1IiLSxnClYzJkAzJDS2izAb5Ndvzcz5AUvxAtnCegjGZkITLKohSykE89l5vbDTCuvZoc4Oh8YeprZlsZJ3cAAFNux3EONWHqYUdGuJlGYGkSmmnPNW7R+OL4Ir9eEUQYr0nNxGJtvkr2qDo3TisoeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=S2ppIrWy; 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="S2ppIrWy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABBFA1F00893; Sat, 30 May 2026 17:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780161374; bh=8qS1VrhKIwKQvcKk+0Mh4CIgZyQobi227iuJc1Viz0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S2ppIrWy+RQwIIEUoqN+GhBHbsmg2Nz9oup01nwyWr1xXV4OSKxnTSA84wcrYycbI ywznIa7CrGEf3TRIXM3PPALBVqawZWGxMMpabVpy088CNeF6N4nLQCbd+vzA35CigY SyTQ2KGk+rf/yxRDb1DVcNlr1W7ORqyErfZVJWPU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Hawley , Andrea Righi , Marcos Paulo de Souza , Matthieu Baerts , Fernando Fernandez Mancera , Pedro Falcato , "=?UTF-8?q?Ricardo=20B . =20Marli=C3=A8re?=" , Steven Rostedt , Sasha Levin Subject: [PATCH 6.1 565/969] ktest: Honor empty per-test option overrides Date: Sat, 30 May 2026 18:01:29 +0200 Message-ID: <20260530160315.994487480@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ricardo B. Marlière [ Upstream commit a2de57a3c8192dcd67cccaff6c341b93748d799b ] A per-test override can clear an inherited default option by assigning an empty value, but __set_test_option() still used option_defined() to decide whether a per-test key existed. That turned an empty per-test assignment back into "fall back to the default", so tests still could not clear inherited settings. For example: DEFAULTS (...) LOG_FILE = /tmp/ktest-empty-override.log CLEAR_LOG = 1 ADD_CONFIG = /tmp/.config TEST_START TEST_TYPE = build BUILD_TYPE = nobuild ADD_CONFIG = This would run the test with ADD_CONFIG[1] = /tmp/.config Fix by checking whether the per-test key exists before falling back. If it does exist but is empty, treat it as unset for that test and stop the fallback chain there. Cc: John Hawley Cc: Andrea Righi Cc: Marcos Paulo de Souza Cc: Matthieu Baerts Cc: Fernando Fernandez Mancera Cc: Pedro Falcato Link: https://patch.msgid.link/20260307-ktest-fixes-v1-4-565d412f4925@suse.com Fixes: 22c37a9ac49d ("ktest: Allow tests to undefine default options") Signed-off-by: Ricardo B. Marlière Signed-off-by: Steven Rostedt Signed-off-by: Sasha Levin --- tools/testing/ktest/ktest.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index d752c4bd0d8b3..28eebfa32621d 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -4106,7 +4106,8 @@ sub __set_test_option { my $option = "$name\[$i\]"; - if (option_defined($option)) { + if (exists($opt{$option})) { + return undef if (!option_defined($option)); return $opt{$option}; } @@ -4114,7 +4115,8 @@ sub __set_test_option { if ($i >= $test && $i < $test + $repeat_tests{$test}) { $option = "$name\[$test\]"; - if (option_defined($option)) { + if (exists($opt{$option})) { + return undef if (!option_defined($option)); return $opt{$option}; } } -- 2.53.0