diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index f3cda984b..6e762e424 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -512,7 +512,7 @@ _spdk_iscsi_conn_check_shutdown(void *arg) rc = spdk_iscsi_conn_free_tasks(conn); if (rc < 0) { - return -1; + return 1; } spdk_poller_unregister(&conn->shutdown_timer); @@ -520,7 +520,7 @@ _spdk_iscsi_conn_check_shutdown(void *arg) spdk_iscsi_conn_stop(conn); _spdk_iscsi_conn_free(conn); - return -1; + return 1; } static void @@ -550,14 +550,14 @@ _spdk_iscsi_conn_check_pending_tasks(void *arg) struct spdk_iscsi_conn *conn = arg; if (conn->dev != NULL && spdk_scsi_dev_has_pending_tasks(conn->dev)) { - return -1; + return 1; } spdk_poller_unregister(&conn->shutdown_timer); _spdk_iscsi_conn_destruct(conn); - return -1; + return 1; } void @@ -620,14 +620,16 @@ spdk_iscsi_conn_check_shutdown(void *arg) { struct spdk_event *event; - if (spdk_iscsi_get_active_conns() == 0) { - spdk_poller_unregister(&g_shutdown_timer); - event = spdk_event_allocate(spdk_env_get_current_core(), - spdk_iscsi_conn_check_shutdown_cb, NULL, NULL); - spdk_event_call(event); + if (spdk_iscsi_get_active_conns() != 0) { + return 1; } - return -1; + spdk_poller_unregister(&g_shutdown_timer); + event = spdk_event_allocate(spdk_env_get_current_core(), + spdk_iscsi_conn_check_shutdown_cb, NULL, NULL); + spdk_event_call(event); + + return 1; } static void @@ -1218,14 +1220,6 @@ spdk_iscsi_conn_flush_pdus_internal(struct spdk_iscsi_conn *conn) * * During other connection states (EXITING or LOGGED_OUT), this * function will spin until all PDUs have successfully been flushed. - * - * Returns 0 for success and when all PDUs were able to be flushed. - * - * Returns 1 for success but when some PDUs could not be flushed due - * to lack of TCP buffer space. - * - * Returns -1 for an exceptional error indicating the TCP connection - * should be closed. */ static int spdk_iscsi_conn_flush_pdus(void *_conn) @@ -1238,7 +1232,8 @@ spdk_iscsi_conn_flush_pdus(void *_conn) if (rc == 0 && conn->flush_poller != NULL) { spdk_poller_unregister(&conn->flush_poller); } else if (rc == 1 && conn->flush_poller == NULL) { - conn->flush_poller = spdk_poller_register(spdk_iscsi_conn_flush_pdus, conn, 50); + conn->flush_poller = spdk_poller_register(spdk_iscsi_conn_flush_pdus, + conn, 50); } } else { /* @@ -1261,7 +1256,7 @@ spdk_iscsi_conn_flush_pdus(void *_conn) conn->state = ISCSI_CONN_STATE_EXITING; } - return -1; + return 1; } void diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 23feea7ac..3c0c3eb71 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -3263,7 +3263,7 @@ _spdk_iscsi_op_abort_task(void *arg) rc = spdk_iscsi_conn_abort_queued_datain_task(task->conn, task->scsi.abort_id); if (rc != 0) { - return 0; + return 1; } spdk_poller_unregister(&task->mgmt_poller); @@ -3288,7 +3288,7 @@ _spdk_iscsi_op_abort_task_set(void *arg) rc = spdk_iscsi_conn_abort_queued_datain_tasks(task->conn, task->scsi.lun, task->pdu); if (rc != 0) { - return 0; + return 1; } spdk_poller_unregister(&task->mgmt_poller);