From: Guenter Roeck <linux@roeck-us.net>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: kernel-tls-handshake@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: Persistent problem with handshake unit tests
Date: Tue, 6 Feb 2024 11:05:36 -0800 [thread overview]
Message-ID: <e6e235a2-85d9-4e3d-9ee4-3a9f00aaf1a5@roeck-us.net> (raw)
In-Reply-To: <6904162b-5ac1-4f2c-a48a-02c104f6fe4c@roeck-us.net>
On 2/6/24 09:55, Guenter Roeck wrote:
[ ...]
>
> Since the destroy function runs asynchronously, the best I could come up with
> was to use completion handling. The following patch fixes the problem for me.
>
I don't know if it is a proper fix, but I no longer see the problem with
the patch below applied on top of v6.8-rc3.
Guenter
>
> ---
> diff --git a/net/handshake/handshake-test.c b/net/handshake/handshake-test.c
> index 16ed7bfd29e4..dc119c1e211b 100644
> --- a/net/handshake/handshake-test.c
> +++ b/net/handshake/handshake-test.c
> @@ -432,9 +432,12 @@ static void handshake_req_cancel_test3(struct kunit *test)
>
> static struct handshake_req *handshake_req_destroy_test;
>
> +static DECLARE_COMPLETION(handshake_request_destroyed);
> +
> static void test_destroy_func(struct handshake_req *req)
> {
> handshake_req_destroy_test = req;
> + complete(&handshake_request_destroyed);
> }
>
> static struct handshake_proto handshake_req_alloc_proto_destroy = {
> @@ -473,6 +476,8 @@ static void handshake_req_destroy_test1(struct kunit *test)
> /* Act */
> fput(filp);
>
> + wait_for_completion_timeout(&handshake_request_destroyed, msecs_to_jiffies(100));
> +
> /* Assert */
> KUNIT_EXPECT_PTR_EQ(test, handshake_req_destroy_test, req);
> }
>
>
>
next prev parent reply other threads:[~2024-02-06 19:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 17:21 Persistent problem with handshake unit tests Guenter Roeck
2024-02-02 19:22 ` Jakub Kicinski
2024-02-02 20:49 ` Guenter Roeck
2024-02-02 20:51 ` Guenter Roeck
2024-02-03 0:47 ` Jakub Kicinski
2024-02-03 1:45 ` Guenter Roeck
2024-02-03 2:27 ` Jakub Kicinski
2024-02-03 3:46 ` Chuck Lever III
2024-02-03 3:54 ` Guenter Roeck
2024-02-06 16:47 ` Chuck Lever
2024-02-06 17:55 ` Guenter Roeck
2024-02-06 19:05 ` Guenter Roeck [this message]
2024-02-06 19:07 ` Chuck Lever
2024-02-06 19:24 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e6e235a2-85d9-4e3d-9ee4-3a9f00aaf1a5@roeck-us.net \
--to=linux@roeck-us.net \
--cc=chuck.lever@oracle.com \
--cc=kernel-tls-handshake@lists.linux.dev \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).