nvme-target tcp: fix unhandled tcp states in nvmet_tcp_state_change()
Subsystems (2)
PATCH 1/1 nvme-target 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 it's safe to call nvmet_tcp_schedule_release_queue() 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
Signed-off-by Maurizio Lombardi <[email protected]>
--- drivers/nvme/target/tcp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/target/tcp.c +2 -0
@@ -1524,6 +1524,8 @@ static void nvmet_tcp_state_change(struct sock *sk)switch (sk->sk_state) {case TCP_FIN_WAIT1 : +case TCP_FIN_WAIT2 : +case TCP_LAST_ACK :case TCP_CLOSE_WAIT :case TCP_CLOSE :/* FALLTHRU */
Signature · 1 line
2.31.1
Sagi Grimberg
maintainerQuoted 20 lines
TCP_FIN_WAIT2andTCP_LAST_ACKwere not handled, the connection is closing so it's safe to callnvmet_tcp_schedule_release_queue()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 5Signed-off-by Maurizio Lombardi <[email protected]>--- drivers/nvme/target/tcp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/nvme/target/tcp.c +0
-0
drivers/nvme/target/tcp.c static void nvmet_tcp_state_change(struct sock *sk) · line 1531
Quoted 8 lines
drivers/nvme/target/tcp.c +2
-0@@ -1524,6 +1524,8 @@ static void nvmet_tcp_state_change(struct sock *sk)switch (sk->sk_state) {case TCP_FIN_WAIT1 : +case TCP_FIN_WAIT2 : +case TCP_LAST_ACK :case TCP_CLOSE_WAIT :case TCP_CLOSE :/* FALLTHRU */
I know that nvmet_tcp_schedule_release_queue is safe, but I think we for sure called it before these events, so won't it be better for readability to just do nothing when we get these events?