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 4A685158A19; Tue, 9 Jul 2024 11:29:37 +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=1720524577; cv=none; b=oAQQ+ThcFaXpuT7usBgbhNiaIvI9oiHB9/fV0K/HOM8lB4L80k9jTfE5566zX0s3XefLd6JbemsoFjkOQ3/AnbvQMv41rHz/IgjYc8rraCwI43Ohk0afuWJ8xlIu/2fdTSRpmT1ZGcecIRjYqH7TxUYhh+PDfRqRUYde1HJJWC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720524577; c=relaxed/simple; bh=uS1kRYGqageOhj8MoZ54RT15CKFtzaoccrPfZ6G/nzE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OC/j3rZ5D5Afs0J9siSmj5jb8Xc52a9YIuRQ4jF6ZK0aT3nfj2uTRdEv3LLEjIDvXObxwgNtU3+hZBjqbcOit74qd3GegT231dJRSX++FBxJeE5zgVQaN5PVaoMvXCOkDviZ5ilySPkV3vJuqaATKGco+8a1uFi63Bz85CzagBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SWiZMe6d; 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="SWiZMe6d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C83D4C3277B; Tue, 9 Jul 2024 11:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720524577; bh=uS1kRYGqageOhj8MoZ54RT15CKFtzaoccrPfZ6G/nzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SWiZMe6dG+qtPvmAobq4JoUYW8oUz9LxpevSBVRa8XiMDBxPANhmodotq5sCrOXFw 91/DE/ELasNkf7p0EodB/arYgu8vIyX7H8OQUKdhZYf+rN9IN+MQmW/HN1MU6WOduB TUYb9zM7u1SkHXPbItkUZSER2Enl1QBa6dQkRfzU= 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.1 030/102] kunit: Fix timeout message Date: Tue, 9 Jul 2024 13:09:53 +0200 Message-ID: <20240709110652.542980721@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240709110651.353707001@linuxfoundation.org> References: <20240709110651.353707001@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.1-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