Skip to contentSkip to conversation

nvme-tcp: forward context to teardown admin queue function

PATCH In review Daniel Wagner 4 participants 4 messages Oct 14, 2024 – Oct 21, 2024 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-tcp: forward context to teardown admin queue function

nvme_tcp_setup_ctrl is called from different contexts. If the function is called as part of the initial controller creation, the argument 'new' is set to true. This tells the function to free all resources when an error occurs.

Thus nvme_tcp_teardown_admin_queue should also be called with 'new' and not always with 'false'.

Fixes fd1418de10b9 ("nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue()")
---
 drivers/nvme/host/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp.c +1 -1
index 89c44413c593..c31434b4da73 100644
@@ -2278,7 +2278,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
 	}
 destroy_admin:
 	nvme_stop_keep_alive(ctrl);
-	nvme_tcp_teardown_admin_queue(ctrl, false);
+	nvme_tcp_teardown_admin_queue(ctrl, new);
 	return ret;
 }
 
Signature · 1 line
2.47.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Daniel Wagner

nvme_tcp_setup_ctrl is called from different contexts. If the function is called as part of the initial controller creation, the argument 'new' is set to true. This tells the function to free all resources when an error occurs.

Thus nvme_tcp_teardown_admin_queue should also be called with 'new' and not always with 'false'.

Looks good:

Reviewed-by on v1 1/1
#3 lore raw
In reply to Daniel Wagner
Quoted 19 lines · Daniel Wagner

nvme_tcp_setup_ctrl is called from different contexts. If the function is called as part of the initial controller creation, the argument 'new' is set to true. This tells the function to free all resources when an error occurs.

Thus nvme_tcp_teardown_admin_queue should also be called with 'new' and not always with 'false'.

Fixes fd1418de10b9 ("nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue()")
---
  drivers/nvme/host/tcp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp.c +0 -0
index 89c44413c593..c31434b4da73 100644

drivers/nvme/host/tcp.c static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new) · line 2284

Quoted 8 lines
drivers/nvme/host/tcp.c +1 -1
@@ -2278,7 +2278,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
  	}
  destroy_admin:
  	nvme_stop_keep_alive(ctrl);
-	nvme_tcp_teardown_admin_queue(ctrl, false);
+	nvme_tcp_teardown_admin_queue(ctrl, new);
  	return ret;
  }
 

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich