[SCSI] libfc: when rport goes away (re-plogi), clean up exchanges to/from rport
When a rport goes away, libFC does a plogi which will reset exchanges at the rport. Clean exchanges at our end, both in transport and libFC. If transport hooks into exch_mgr_reset, it will call back into fc_exch_mgr_reset() to clean up libFC exchanges. Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
parent
1f6ff364ce
commit
571f824c3c
1 changed files with 6 additions and 1 deletions
|
@ -214,6 +214,7 @@ static void fc_rport_state_enter(struct fc_rport *rport,
|
||||||
|
|
||||||
static void fc_rport_work(struct work_struct *work)
|
static void fc_rport_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
|
u32 port_id;
|
||||||
struct fc_rport_libfc_priv *rdata =
|
struct fc_rport_libfc_priv *rdata =
|
||||||
container_of(work, struct fc_rport_libfc_priv, event_work);
|
container_of(work, struct fc_rport_libfc_priv, event_work);
|
||||||
enum fc_rport_event event;
|
enum fc_rport_event event;
|
||||||
|
@ -279,8 +280,12 @@ static void fc_rport_work(struct work_struct *work)
|
||||||
rport_ops->event_callback(lport, rport, event);
|
rport_ops->event_callback(lport, rport, event);
|
||||||
if (trans_state == FC_PORTSTATE_ROGUE)
|
if (trans_state == FC_PORTSTATE_ROGUE)
|
||||||
put_device(&rport->dev);
|
put_device(&rport->dev);
|
||||||
else
|
else {
|
||||||
|
port_id = rport->port_id;
|
||||||
fc_remote_port_delete(rport);
|
fc_remote_port_delete(rport);
|
||||||
|
lport->tt.exch_mgr_reset(lport, 0, port_id);
|
||||||
|
lport->tt.exch_mgr_reset(lport, port_id, 0);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
mutex_unlock(&rdata->rp_mutex);
|
mutex_unlock(&rdata->rp_mutex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue