Skip to contentSkip to conversation

nvmet-tcp: fix unhandled tcp states in nvmet_tcp_state_change()

PATCH Applied Maurizio Lombardi 4 participants 4 messages Aug 29, 2022 – Aug 31, 2022

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

PATCH v2 1/1 nvmet-tcp: fix unhandled tcp states in nvmet_tcp_state_change()

TCP_FIN_WAIT2 and TCP_LAST_ACK were not handled, the connection is closing so we can ignore them and avoid printing the "unhandled state" warning message.

[ 1298.852386] nvmet_tcp: queue 2 unhandled state 5
[ 1298.879112] nvmet_tcp: queue 7 unhandled state 5
[ 1298.884253] nvmet_tcp: queue 8 unhandled state 5
[ 1298.889475] nvmet_tcp: queue 9 unhandled state 5

v2: Do not call nvmet_tcp_schedule_release_queue(), just ignore the fin_wait2 and last_ack states.

---
 drivers/nvme/target/tcp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/nvme/target/tcp.c +3 -0
index 5f9303232e86..3ee106ca7fe8 100644
@@ -1523,6 +1523,9 @@ static void nvmet_tcp_state_change(struct sock *sk)
 		goto done;
 
 	switch (sk->sk_state) {
+	case TCP_FIN_WAIT2:
+	case TCP_LAST_ACK:
+		break;
 	case TCP_FIN_WAIT1:
 	case TCP_CLOSE_WAIT:
 	case TCP_CLOSE:
Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#2 lore raw
In reply to Maurizio Lombardi
Quoted 9 lines · Maurizio Lombardi

TCP_FIN_WAIT2 and TCP_LAST_ACK were not handled, the connection is closing so we can ignore them and avoid printing the "unhandled state" warning message.

[ 1298.852386] nvmet_tcp: queue 2 unhandled state 5
[ 1298.879112] nvmet_tcp: queue 7 unhandled state 5
[ 1298.884253] nvmet_tcp: queue 8 unhandled state 5
[ 1298.889475] nvmet_tcp: queue 9 unhandled state 5
Quoted 4 lines

v2: Do not call nvmet_tcp_schedule_release_queue(), just ignore the fin_wait2 and last_ack states.

Looks good.

-ck