public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel•org>
To: allison.henderson@oracle•com
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH v2 7/8] net/rds: rds_tcp_conn_path_shutdown must not discard messages
Date: Thu, 17 Apr 2025 10:47:08 +0100	[thread overview]
Message-ID: <20250417094708.GD2430521@horms.kernel.org> (raw)
In-Reply-To: <20250411180207.450312-8-allison.henderson@oracle.com>

On Fri, Apr 11, 2025 at 11:02:06AM -0700, allison.henderson@oracle•com wrote:

...

> diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
> index 30146204dc6c..a9596440a456 100644
> --- a/net/rds/tcp_listen.c
> +++ b/net/rds/tcp_listen.c
> @@ -299,6 +299,20 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
>  		rds_tcp_set_callbacks(new_sock, cp);
>  		rds_connect_path_complete(cp, RDS_CONN_CONNECTING);
>  	}
> +
> +	/* Since "rds_tcp_set_callbacks" happens this late
> +	 * the connection may already have been closed without
> +	 * "rds_tcp_state_change" doing its due dilligence.

nit: diligence

checkpatch.pl --codespell is your friend :)

> +	 *
> +	 * If that's the case, we simply drop the path,
> +	 * knowing that "rds_tcp_conn_path_shutdown" will
> +	 * dequeue pending messages.
> +	 */
> +	if (new_sock->sk->sk_state == TCP_CLOSE_WAIT ||
> +	    new_sock->sk->sk_state == TCP_LAST_ACK ||
> +	    new_sock->sk->sk_state == TCP_CLOSE)
> +		rds_conn_path_drop(cp, 0);
> +
>  	new_sock = NULL;
>  	ret = 0;
>  	if (conn->c_npaths == 0)

  reply	other threads:[~2025-04-17  9:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 18:01 [PATCH v2 0/8] RDS bug fix collection allison.henderson
2025-04-11 18:02 ` [PATCH v2 1/8] net/rds: Add per cp work queue allison.henderson
2025-04-17  9:44   ` Simon Horman
2025-04-21 15:17     ` Allison Henderson
2025-04-11 18:02 ` [PATCH v2 2/8] net/rds: Introduce a pool of worker threads for connection management allison.henderson
2025-04-15  0:46   ` Jakub Kicinski
2025-04-15 21:33     ` Allison Henderson
2025-04-11 18:02 ` [PATCH v2 3/8] net/rds: Re-factor queuing of shutdown work allison.henderson
2025-04-11 18:02 ` [PATCH v2 4/8] net/rds: No shortcut out of RDS_CONN_ERROR allison.henderson
2025-04-15  0:47   ` Jakub Kicinski
2025-04-11 18:02 ` [PATCH v2 5/8] net/rds: rds_tcp_accept_one ought to not discard messages allison.henderson
2025-04-11 18:02 ` [PATCH v2 6/8] net/rds: Encode cp_index in TCP source port allison.henderson
2025-04-11 18:02 ` [PATCH v2 7/8] net/rds: rds_tcp_conn_path_shutdown must not discard messages allison.henderson
2025-04-17  9:47   ` Simon Horman [this message]
2025-04-21 15:16     ` Allison Henderson
2025-04-11 18:02 ` [PATCH v2 8/8] net/rds: Kick-start TCP receiver after accept allison.henderson

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=20250417094708.GD2430521@horms.kernel.org \
    --to=horms@kernel$(echo .)org \
    --cc=allison.henderson@oracle$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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