[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6e235a2-85d9-4e3d-9ee4-3a9f00aaf1a5@roeck-us.net>
Date: Tue, 6 Feb 2024 11:05:36 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Chuck Lever <chuck.lever@...cle.com>
Cc: kernel-tls-handshake@...ts.linux.dev, netdev@...r.kernel.org
Subject: Re: Persistent problem with handshake unit tests
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);
> }
>
>
>
Powered by blists - more mailing lists