Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Alistair Francis <alistair23@gmail.com>,
	hch@lst.de, sagi@grimberg.me, kch@nvidia.com,
	linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, csander@purestorage.com,
	shinichiro.kawasaki@wdc.com,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH] nvmet-tcp: don't restore null sk_state_change
Date: Wed, 23 Apr 2025 08:21:34 +0200	[thread overview]
Message-ID: <ed993f55-bdfc-4376-951d-9af4a4f461a9@suse.de> (raw)
In-Reply-To: <20250423060621.632581-1-alistair.francis@wdc.com>

On 4/23/25 08:06, Alistair Francis wrote:
> queue->state_change is set as part of nvmet_tcp_set_queue_sock(), but if
> the TCP connection isn't established when nvmet_tcp_set_queue_sock() is
> called then queue->state_change isn't set and sock->sk->sk_state_change
> isn't replaced.
> 
> As such we don't need to restore sock->sk->sk_state_change if
> queue->state_change is NULL.
> 
Good catch!

[ .. ]

> Resolves: https://lore.kernel.org/linux-nvme/5hdonndzoqa265oq3bj6iarwtfk5dewxxjtbjvn5uqnwclpwt6@a2n6w3taxxex/
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> We could also remove the `sock->sk->sk_state != TCP_ESTABLISHED` check
> in nvmet_tcp_set_queue_sock() if that's prefered.
> 
Please do.
We cannot influence what the network stack did, so if there ever were a 
modification which caused the ->state_change callback _not_ to be set
the whole issue pops up again.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich


  reply	other threads:[~2025-04-23  6:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23  6:06 [PATCH] nvmet-tcp: don't restore null sk_state_change Alistair Francis
2025-04-23  6:21 ` Hannes Reinecke [this message]
2025-04-23 21:47   ` Alistair Francis
2025-04-23 22:36     ` Alistair Francis
2025-04-24  1:38 ` Shinichiro Kawasaki
2025-04-25 22:11 ` Sagi Grimberg
2025-04-29 13:09 ` Christoph Hellwig

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=ed993f55-bdfc-4376-951d-9af4a4f461a9@suse.de \
    --to=hare@suse.de \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=csander@purestorage.com \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=shinichiro.kawasaki@wdc.com \
    /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