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 7CAD1155389; Tue, 9 Jul 2024 11:13:13 +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=1720523593; cv=none; b=JIDxGNm8s0ycVbnUHPMOMz3xTnSXxR3JxirppNpFhkmDO5XkTafgJZLyb0TrwyeWW+Q7Cy7YBM0Ws0UAuzCNCHzU1T6TNFvqchrY5rI8XOfGDNVuv9O0HtXYBVbR4mLn9MSnWslrII4AeSEwwFb6L4+S3oTB6C3TYw5IRL5ai+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720523593; c=relaxed/simple; bh=wUZnMv7e35BDW1RrpTR12II+6u6BnnsfUioD3NBN02A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HokgEI1M/Gz/F9SRTZc6FfOVjtKECLvBddwsiMujY97VQIBvrFEQdMTu03JvNDzRibc+WZuxMHadoiyT2hhdfDJ5fUx0jMYQcVf0xfuo98meGwptKysl+RYeo77ysazL3HryGX2FihLaVXe3olpB0ITlpFfIyGrh7KY6j9gQDcI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qxRC2+f/; 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="qxRC2+f/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04DFFC3277B; Tue, 9 Jul 2024 11:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720523593; bh=wUZnMv7e35BDW1RrpTR12II+6u6BnnsfUioD3NBN02A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxRC2+f/W1IB2PFx+jK4U9HI5G/n3Z820p/80nKUW7LNuPo1Yjz2wRZoIQnnUa1po vawJRcrfEZJZDIvH2D66gzjuA0OvNZSoOgG4pe/iFQ5sdcJDjsSgBXrcdw72TJL7bg PG+iYSTkanDE1jgjlcS2fKJHwwh8NCZEmZJWZh38= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Brendan Higgins , Shuah Khan , Kees Cook , David Gow , Rae Moar , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Sasha Levin Subject: [PATCH 6.6 043/139] kunit: Fix timeout message Date: Tue, 9 Jul 2024 13:09:03 +0200 Message-ID: <20240709110659.831890017@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240709110658.146853929@linuxfoundation.org> References: <20240709110658.146853929@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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mickaël Salaün [ Upstream commit 53026ff63bb07c04a0e962a74723eb10ff6f9dc7 ] The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Reviewed-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-4-mic@digikod.net Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/kunit/try-catch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c index d9d1df28cc52e..9c9e4dcf06d96 100644 --- a/lib/kunit/try-catch.c +++ b/lib/kunit/try-catch.c @@ -78,7 +78,6 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) time_remaining = wait_for_completion_timeout(&try_completion, kunit_test_timeout()); if (time_remaining == 0) { - kunit_err(test, "try timed out\n"); try_catch->try_result = -ETIMEDOUT; kthread_stop(task_struct); } @@ -93,6 +92,8 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) try_catch->try_result = 0; else if (exit_code == -EINTR) kunit_err(test, "wake_up_process() was never called\n"); + else if (exit_code == -ETIMEDOUT) + kunit_err(test, "try timed out\n"); else if (exit_code) kunit_err(test, "Unknown error: %d\n", exit_code); -- 2.43.0