From: Abhijeet Joglekar Date: Tue, 21 Apr 2009 23:27:14 +0000 (-0700) Subject: [SCSI] libfc: Change state to NONE in fc_lport_destroy X-Git-Tag: v2.6.30-rc5~53^2~22 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bbf156697a6332f9074e2b275a9157d99a431398;p=karo-tx-linux.git [SCSI] libfc: Change state to NONE in fc_lport_destroy After lport_destroy, the local port should not be used again. Transition to state NONE, any incoming frames or link up should not transition out of this state since we are deleting exchange table and cleaning up the local port. Also, mark link as down. Signed-off-by: Abhijeet Joglekar Signed-off-by: Robert Love Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 4cd953378c57..e0c247724d2b 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -644,7 +644,12 @@ EXPORT_SYMBOL(fc_fabric_logoff); */ int fc_lport_destroy(struct fc_lport *lport) { + mutex_lock(&lport->lp_mutex); + lport->state = LPORT_ST_NONE; + lport->link_up = 0; lport->tt.frame_send = fc_frame_drop; + mutex_unlock(&lport->lp_mutex); + lport->tt.fcp_abort_io(lport); lport->tt.exch_mgr_reset(lport, 0, 0); return 0;