Skip to contentSkip to conversation

nvmet-tcp: handle TCP_CLOSING state in nvmet_tcp_state_change

PATCH Applied Maurizio Lombardi 3 participants 4 messages Mar 16 – Jun 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet-tcp: handle TCP_CLOSING state in nvmet_tcp_state_change

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.

---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/target/tcp.c +1 -0
index acc71a26733f..ce497843b979 100644
@@ -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:
Signature · 1 line
2.53.0
#1 lore raw
Quoted 21 lines · Maurizio Lombardi

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.

---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/target/tcp.c +0 -0
index acc71a26733f..ce497843b979 100644

drivers/nvme/target/tcp.c static void nvmet_tcp_state_change(struct sock *sk) · line 1673

Quoted 7 lines
drivers/nvme/target/tcp.c +1 -0
@@ -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

#2 lore raw
In reply to Maurizio Lombardi
Quoted 21 lines · Maurizio Lombardi

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.

---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/target/tcp.c +0 -0
index acc71a26733f..ce497843b979 100644

drivers/nvme/target/tcp.c static void nvmet_tcp_state_change(struct sock *sk) · line 1673

Quoted 7 lines
drivers/nvme/target/tcp.c +1 -0
@@ -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:

Ping, it looks this patch has been forgotten
Can I get some reviews?

Maurizio

maintainer Applied
#3 lore raw
In reply to Maurizio Lombardi
Quoted 10 lines · Maurizio Lombardi

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.

Thanks, applied to nvme-7.2.