iscsi: Refactor spdk_iscsi_conn_destruct() as a preparation to fix the issue
The next patch will change spdk_iscsi_conn_destruct() to fix the Github issue #457. This patch is a preparation to that. Change-Id: Iaf1c8a3fe8514d6bbd9f61f19f87b0bb2c27e76e Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/430402 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
3f12b5fa1e
commit
c18562d694
@ -474,18 +474,21 @@ static void
|
||||
spdk_iscsi_conn_cleanup_backend(struct spdk_iscsi_conn *conn)
|
||||
{
|
||||
int rc;
|
||||
struct spdk_iscsi_tgt_node *target;
|
||||
|
||||
if (conn->sess->connections > 1) {
|
||||
/* connection specific cleanup */
|
||||
} else if (!g_spdk_iscsi.AllowDuplicateIsid) {
|
||||
/* clean up all tasks to all LUNs for session */
|
||||
rc = spdk_iscsi_tgt_node_cleanup_luns(conn,
|
||||
conn->sess->target);
|
||||
target = conn->sess->target;
|
||||
if (target != NULL) {
|
||||
rc = spdk_iscsi_tgt_node_cleanup_luns(conn, target);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("target abort failed\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_spdk_iscsi_conn_free(struct spdk_iscsi_conn *conn)
|
||||
@ -517,17 +520,13 @@ _spdk_iscsi_conn_check_shutdown(void *arg)
|
||||
void
|
||||
spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn)
|
||||
{
|
||||
struct spdk_iscsi_tgt_node *target;
|
||||
int rc;
|
||||
|
||||
conn->state = ISCSI_CONN_STATE_EXITED;
|
||||
|
||||
if (conn->sess != NULL && conn->pending_task_cnt > 0) {
|
||||
target = conn->sess->target;
|
||||
if (target != NULL) {
|
||||
spdk_iscsi_conn_cleanup_backend(conn);
|
||||
}
|
||||
}
|
||||
|
||||
spdk_clear_all_transfer_task(conn, NULL);
|
||||
spdk_iscsi_poll_group_remove_conn_sock(conn);
|
||||
|
Loading…
Reference in New Issue
Block a user