From 9a6a5611494069e0bb80c29bedb8ad61b08db733 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Mon, 13 Jul 2020 20:05:03 +0800 Subject: [PATCH] lib/iscsi: Change the order of executing iscsi_clear_all_transfer_task In my mind, we should firstly remove the sock from the group, then all the call_cb of pdus will be handled, then we clear the task, we can avoid the duplicated resource recycling. Signed-off-by: Ziye Yang Change-Id: Ic5fad130e58c9dcb42a237973979b042eabdf43a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3309 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- lib/iscsi/conn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index ead89e03c..4c7a54fcf 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -665,10 +665,9 @@ _iscsi_conn_destruct(struct spdk_iscsi_conn *conn) { int rc; - iscsi_clear_all_transfer_task(conn, NULL, NULL); - iscsi_poll_group_remove_conn(conn->pg, conn); spdk_sock_close(&conn->sock); + iscsi_clear_all_transfer_task(conn, NULL, NULL); spdk_poller_unregister(&conn->logout_request_timer); spdk_poller_unregister(&conn->logout_timer);