[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcKDd1to4MPANCrn@tissot.1015granger.net>
Date: Tue, 6 Feb 2024 14:07:35 -0500
From: Chuck Lever <chuck.lever@...cle.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: kernel-tls-handshake@...ts.linux.dev, netdev@...r.kernel.org
Subject: Re: Persistent problem with handshake unit tests
On Tue, Feb 06, 2024 at 11:05:36AM -0800, Guenter Roeck wrote:
> 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.
I've got something similar but simpler that I will post with a full
patch description, root cause, and rationale. Stand by.
> 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);
> > }
> >
> >
> >
>
--
Chuck Lever
Powered by blists - more mailing lists