mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-23 21:51:27 +00:00
Fix problems in marking sessions local
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2635 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -878,7 +878,6 @@ static void q2t_del_sess_work_fn(struct delayed_work *work)
|
||||
sess->port_name[4], sess->port_name[5],
|
||||
sess->port_name[6], sess->port_name[7],
|
||||
sess->loop_id);
|
||||
sess->local = 1;
|
||||
} else {
|
||||
/*
|
||||
* sess will be deleted from del_sess_list in
|
||||
@@ -900,6 +899,7 @@ static void q2t_del_sess_work_fn(struct delayed_work *work)
|
||||
return;
|
||||
}
|
||||
|
||||
/* pha->hardware_lock supposed to be held on entry */
|
||||
static void q2t_undelete_sess(struct q2t_sess *sess)
|
||||
{
|
||||
sBUG_ON(!sess->deleted);
|
||||
@@ -952,7 +952,7 @@ static struct q2t_sess *q2t_create_sess(scsi_qla_host_t *ha, fc_port_t *fcport,
|
||||
sess->loop_id = fcport->loop_id;
|
||||
sess->conf_compl_supported = fcport->conf_compl_supported;
|
||||
if (sess->local && !local)
|
||||
sess->local = false;
|
||||
sess->local = 0;
|
||||
spin_unlock_irq(&pha->hardware_lock);
|
||||
goto out;
|
||||
}
|
||||
@@ -1039,16 +1039,17 @@ out_free_sess:
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* pha->hardware_lock supposed to be held on entry */
|
||||
static void q2t_reappear_sess(struct q2t_sess *sess, const char *reason)
|
||||
{
|
||||
q2t_undelete_sess(sess);
|
||||
|
||||
PRINT_INFO("qla2x00t(%ld): session for port %02x:"
|
||||
PRINT_INFO("qla2x00t(%ld): %ssession for port %02x:"
|
||||
"%02x:%02x:%02x:%02x:%02x:%02x:%02x (loop ID %d) "
|
||||
"reappeared%s", sess->tgt->ha->instance, sess->port_name[0],
|
||||
sess->port_name[1], sess->port_name[2],
|
||||
sess->port_name[3], sess->port_name[4],
|
||||
sess->port_name[5], sess->port_name[6],
|
||||
"reappeared%s", sess->tgt->ha->instance,
|
||||
sess->local ? "local " : "", sess->port_name[0],
|
||||
sess->port_name[1], sess->port_name[2], sess->port_name[3],
|
||||
sess->port_name[4], sess->port_name[5], sess->port_name[6],
|
||||
sess->port_name[7], sess->loop_id, reason);
|
||||
TRACE_MGMT_DBG("Appeared sess %p", sess);
|
||||
}
|
||||
@@ -1083,19 +1084,19 @@ static void q2t_fc_port_added(scsi_qla_host_t *ha, fc_port_t *fcport)
|
||||
} else {
|
||||
if (sess->deleted)
|
||||
q2t_reappear_sess(sess, "");
|
||||
else if (sess->local) {
|
||||
TRACE(TRACE_MGMT, "qla2x00t(%ld): local session for "
|
||||
"port %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
|
||||
"(loop ID %d) became global", ha->instance,
|
||||
fcport->port_name[0], fcport->port_name[1],
|
||||
fcport->port_name[2], fcport->port_name[3],
|
||||
fcport->port_name[4], fcport->port_name[5],
|
||||
fcport->port_name[6], fcport->port_name[7],
|
||||
sess->loop_id);
|
||||
}
|
||||
}
|
||||
|
||||
sess->local = 0;
|
||||
if (sess->local) {
|
||||
TRACE(TRACE_MGMT, "qla2x00t(%ld): local session for "
|
||||
"port %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
|
||||
"(loop ID %d) became global", ha->instance,
|
||||
fcport->port_name[0], fcport->port_name[1],
|
||||
fcport->port_name[2], fcport->port_name[3],
|
||||
fcport->port_name[4], fcport->port_name[5],
|
||||
fcport->port_name[6], fcport->port_name[7],
|
||||
sess->loop_id);
|
||||
sess->local = 0;
|
||||
}
|
||||
|
||||
spin_unlock_irq(&pha->hardware_lock);
|
||||
|
||||
@@ -1130,6 +1131,9 @@ static void q2t_fc_port_deleted(scsi_qla_host_t *ha, fc_port_t *fcport)
|
||||
if (sess == NULL)
|
||||
goto out_unlock_ha;
|
||||
|
||||
TRACE_MGMT_DBG("sess %p", sess);
|
||||
|
||||
sess->local = 1;
|
||||
q2t_schedule_sess_for_deletion(sess);
|
||||
|
||||
out_unlock_ha:
|
||||
|
||||
Reference in New Issue
Block a user