Skip to contentSkip to conversation

nvme-rc: Cleanup fcloop resources in reverse order

PATCH Superseded Daniel Wagner 1 participant 2 messages Apr 18, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-rc: Cleanup fcloop resources in reverse order

We need to free the resources in the opposite order as we allocate them. The deleting the rport first will also free the other resources. When we try to release lport and tport they are already gone.

---
 tests/nvme/rc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/nvme/rc +2 -2
index b44239446dcf..ec0cc2d8d8cc 100644
@@ -204,10 +204,10 @@ _cleanup_fcloop() {
 	local remote_wwnn="${3:-$def_remote_wwnn}"
 	local remote_wwpn="${4:-$def_remote_wwpn}"
 
-	_nvme_fcloop_del_rport "${local_wwnn}" "${local_wwpn}" \
-			       "${remote_wwnn}" "${remote_wwpn}"
 	_nvme_fcloop_del_tport "${remote_wwnn}" "${remote_wwpn}"
 	_nvme_fcloop_del_lport "${local_wwnn}" "${local_wwpn}"
+	_nvme_fcloop_del_rport "${local_wwnn}" "${local_wwpn}" \
+			       "${remote_wwnn}" "${remote_wwpn}"
 }
 
 _cleanup_nvmet() {
Signature · 1 line
2.40.0
#1 lore raw
Quoted 3 lines · Daniel Wagner

We need to free the resources in the opposite order as we allocate them. The deleting the rport first will also free the other resources. When we try to release lport and tport they are already gone.

I found some more ordering issues with fcloop resources.