All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: "kernel-tls-handshake@lists.linux.dev"
	<kernel-tls-handshake@lists.linux.dev>
Subject: Re: [PATCH] handshake: set hr_sk field earlier in handshake_req_submit
Date: Tue, 28 Mar 2023 16:29:15 -0400	[thread overview]
Message-ID: <44b718e213a57ea3018f4fac6c648c35ed1d1977.camel@kernel.org> (raw)
In-Reply-To: <CE691A38-999E-4128-880D-F6A5AEB20D79@oracle.com>

On Tue, 2023-03-28 at 18:12 +0000, Chuck Lever III wrote:
> 
> > On Mar 28, 2023, at 2:10 PM, Jeff Layton <jlayton@kernel.org> wrote:
> > 
> > Otherwise, the request is always hashed with the socket set to a NULL
> > pointer.
> 
> Sounds plausible. I will need to check the clean-up paths too.
> 

You're right about the error paths. The sock refcounting will need to be
fixed up for sure.

With this but fixed on both ends though, it works for me pretty
consistently now. I guess I was just unlucky with the hashing!


> 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > net/handshake/request.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > I think this is the problem I was hitting earlier. Chuck, feel free to
> > fold this into the original patch that adds this code.
> > 
> > diff --git a/net/handshake/request.c b/net/handshake/request.c
> > index 54ba304b5bef..44a097210e59 100644
> > --- a/net/handshake/request.c
> > +++ b/net/handshake/request.c
> > @@ -207,6 +207,7 @@ int handshake_req_submit(struct socket *sock, struct handshake_req *req,
> > 	if (READ_ONCE(hn->hn_pending) >= hn->hn_pending_max)
> > 		goto out_err;
> > 
> > +	req->hr_sk = sk;
> > 	req->hr_odestruct = sk->sk_destruct;
> > 	sk->sk_destruct = handshake_sk_destruct;
> > 	spin_lock(&hn->hn_lock);
> > @@ -230,7 +231,6 @@ int handshake_req_submit(struct socket *sock, struct handshake_req *req,
> > 
> > 	/* Prevent socket release while a handshake request is pending */
> > 	sock_hold(sk);
> > -	req->hr_sk = sk;
> > 
> > 	trace_handshake_submit(net, req, sk);
> > 	return 0;
> > -- 
> > 2.39.2
> > 
> 
> --
> Chuck Lever
> 
> 

-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2023-03-28 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 18:10 [PATCH] handshake: set hr_sk field earlier in handshake_req_submit Jeff Layton
2023-03-28 18:12 ` Chuck Lever III
2023-03-28 20:29   ` Jeff Layton [this message]
2023-03-28 20:33     ` Chuck Lever III

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=44b718e213a57ea3018f4fac6c648c35ed1d1977.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kernel-tls-handshake@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.