lib/iscsi: Return if conn->state is already exited when adding conn to poll group
Previously, we fixed a similar bug that iSCSI target got seg. fault if connection is being exited between spdk_iscsi_conn_write_pdu() and its callback iscsi_conn_login_pdu_success_complete() are executed. This fix was not sufficient and we still saw similar error. Not only socket write but also SPDK message is asynchronous and connection may start exiting between iscsi_conn_schedule() and iscsi_conn_full_feature_migrate(). This patch fix this new issue. The previous fix was https://review.spdk.io/gerrit/c/spdk/spdk/+/1275 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I5cc422529a335e5f1982693bdf910ac7debe6f17 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3074 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@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
66aec44a4b
commit
41f59559e1
@ -1570,6 +1570,12 @@ 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(SPDK_LOG_ISCSI, "Connection is already exited.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (conn->sess->session_type == SESSION_TYPE_NORMAL) {
|
||||
iscsi_conn_open_luns(conn);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user