[PATCH] nvmet-tcp: handle TCP_CLOSING state in nvmet_tcp_state_change

Maurizio Lombardi mlombard at arkamax.eu
Thu Mar 26 09:44:41 PDT 2026


On Mon Mar 16, 2026 at 5:44 PM CET, Maurizio Lombardi wrote:
> When an NVMe/TCP connection shuts down, the underlying
> TCP socket can enter the TCP_CLOSING state (state 11).
> Currently, the nvmet_tcp_state_change() callback does not
> explicitly handle this state, which results in harmless but
> noisy kernel warnings:
>
> nvmet_tcp: queue 2 unhandled state 11
>
> Add TCP_CLOSING to the switch statement alongside TCP_FIN_WAIT2 and
> TCP_LAST_ACK to silently ignore the state transition.
>
> Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>
> ---
>  drivers/nvme/target/tcp.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index acc71a26733f..ce497843b979 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -1667,6 +1667,7 @@ static void nvmet_tcp_state_change(struct sock *sk)
>  	switch (sk->sk_state) {
>  	case TCP_FIN_WAIT2:
>  	case TCP_LAST_ACK:
> +	case TCP_CLOSING:
>  		break;
>  	case TCP_FIN_WAIT1:
>  	case TCP_CLOSE_WAIT:

Gentle ping on this one.

Thanks,
Maurizio



More information about the Linux-nvme mailing list