Commit c6951560 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

iscsi: add EXITING conns to pg after full_feature_migrate



Commit 41f59559 added code to skip adding EXITING connections
to the new poll group in the full_feature_migrate message
callback.  The problem is that since the connection is in
EXITING state and is not in a poll group, it will never move
to EXITED state, nor get removed from g_active_conns, and
hence will block the iscsi subsystem from being able to
shutdown.

So instead, assert that the connection is not in EXITED
state.  If it is in EXITING state, we will add it to the
poll group, and then when the poll group is next polled,
it will destroy the connection, moving it to EXITED
state and removing it from the g_active_conns STAILQ.

This fix is related to issue #2416.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ie8e64c811a5602ba4b28871bc535f5fa49dffc18
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16019


Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 1aa807f4
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1492,11 +1492,13 @@ iscsi_conn_full_feature_migrate(void *arg)
{
	struct spdk_iscsi_conn *conn = arg;

	if (conn->state >= ISCSI_CONN_STATE_EXITING) {
		/* Connection is being exited before this callback is executed. */
		SPDK_DEBUGLOG(iscsi, "Connection is already exited.\n");
		return;
	}
	assert(conn->state != ISCSI_CONN_STATE_EXITED);

	/* Note: it is possible that connection could have moved to EXITING
	 * state after this message was sent. We will still add it to the
	 * poll group in this case.  When the poll group is polled
	 * again, it will call iscsi_conn_destruct() on it.
	 */

	if (conn->sess->session_type == SESSION_TYPE_NORMAL) {
		iscsi_conn_open_luns(conn);