diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 3ef2d41ec..972faa2c6 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1258,7 +1258,7 @@ iscsi_conn_flush_pdus_internal(struct spdk_iscsi_conn *conn) * then subsequent calls to this routine will eventually flush * remaining PDUs. * - * During other connection states (EXITING or LOGGED_OUT), this + * During other connection states (EXITING), this * function will spin until all PDUs have successfully been flushed. */ static int @@ -1372,7 +1372,7 @@ iscsi_conn_handle_incoming_pdus(struct spdk_iscsi_conn *conn) return SPDK_ISCSI_CONNECTION_FATAL; } - if (conn->state == ISCSI_CONN_STATE_LOGGED_OUT) { + if (conn->is_logged_out) { SPDK_ERRLOG("pdu received after logout\n"); spdk_put_pdu(pdu); return SPDK_ISCSI_CONNECTION_FATAL; @@ -1499,7 +1499,7 @@ logout_timeout(void *arg) void spdk_iscsi_conn_logout(struct spdk_iscsi_conn *conn) { - conn->state = ISCSI_CONN_STATE_LOGGED_OUT; + conn->is_logged_out = true; conn->logout_timer = spdk_poller_register(logout_timeout, conn, ISCSI_LOGOUT_TIMEOUT * 1000000); } diff --git a/lib/iscsi/conn.h b/lib/iscsi/conn.h index 6ac2fda94..e0983a04d 100644 --- a/lib/iscsi/conn.h +++ b/lib/iscsi/conn.h @@ -88,6 +88,7 @@ struct spdk_iscsi_conn { enum iscsi_connection_state state; int login_phase; + bool is_logged_out; uint64_t last_flush; uint64_t last_fill; diff --git a/lib/iscsi/iscsi.h b/lib/iscsi/iscsi.h index 840d987ef..e5fe3ecfd 100644 --- a/lib/iscsi/iscsi.h +++ b/lib/iscsi/iscsi.h @@ -196,9 +196,8 @@ struct spdk_iscsi_pdu { enum iscsi_connection_state { ISCSI_CONN_STATE_INVALID = 0, ISCSI_CONN_STATE_RUNNING = 1, - ISCSI_CONN_STATE_LOGGED_OUT = 2, - ISCSI_CONN_STATE_EXITING = 3, - ISCSI_CONN_STATE_EXITED = 4, + ISCSI_CONN_STATE_EXITING = 2, + ISCSI_CONN_STATE_EXITED = 3, }; enum iscsi_chap_phase {