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 <ziye.yang@intel.com>
Change-Id: Ic5fad130e58c9dcb42a237973979b042eabdf43a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3309
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Ziye Yang 2020-07-13 20:05:03 +08:00 committed by Tomasz Zawadzki
parent 8e65bfc7e4
commit 9a6a561149

View File

@ -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);