Skip to contentSkip to conversation

nvmet-tcp: do not try to cancel uninitialized tls_handshake_tmo_work

PATCH Superseded Hannes Reinecke 2 participants 3 messages Oct 19, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet-tcp: do not try to cancel uninitialized tls_handshake_tmo_work

The TLS handshake timeout workqueue is only initialized if TLS is configured, so we shouldn't try to de-initialize it unconditionally.

---
 drivers/nvme/target/tcp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/target/tcp.c +2 -0
index 4336fe048e43..e155bcaa42fa 100644
@@ -1587,7 +1587,9 @@ static void nvmet_tcp_release_queue_work(struct work_struct *w)
 	mutex_unlock(&nvmet_tcp_queue_mutex);
 
 	nvmet_tcp_restore_socket_callbacks(queue);
+#ifdef CONFIG_NVME_TARGET_TCP_TLS
 	cancel_delayed_work_sync(&queue->tls_handshake_tmo_work);
+#endif
 	cancel_work_sync(&queue->io_work);
 	/* stop accepting incoming data */
 	queue->rcv_state = NVMET_TCP_RECV_ERR;
Signature · 1 line
2.35.3
maintainer
#1 lore raw
Quoted 3 lines · Hannes Reinecke

The TLS handshake timeout workqueue is only initialized if TLS is configured, so we shouldn't try to de-initialize it unconditionally.

What about the one in nvmet_tcp_tls_handshake_done()?

Please include a fixes line.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Hannes Reinecke

The TLS handshake timeout workqueue is only initialized if TLS is configured, so we shouldn't try to de-initialize it unconditionally.

What about the one in nvmet_tcp_tls_handshake_done()?

That already is encapsulated by the config variable, so nothing to be done here.

Quoted 2 lines

Please include a fixes line.

Oh, sure.

Cheers,

Hannes