aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-08-25 17:01:23 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 13:07:44 -0400
commit00fea930d404b9a9039291d5a61975e6c2ea974e (patch)
treec2d2c32117e74eefdd8876d6903c936cbaf51e06 /drivers
parent9e9d0452fe12115b1c1883c0d4d2ee509079791b (diff)
[SCSI] libfc: fix rport event race between READY and LOGO
When a remote port becomes ready and a LOGO is received before the READY event is in rport_work waiting on the mutex, the event is changed to LOGO and the work queued, so both the calls to rport_work see the LOGO event, and both try to do the list_del(), causing a crash. Don't change the event if it is already set. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libfc/fc_rport.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index a1794a39158e..cbf6c9f233ca 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1267,9 +1267,7 @@ static void fc_rport_recv_logo_req(struct fc_rport_priv *rdata,
1267 return; 1267 return;
1268 } 1268 }
1269 1269
1270 rdata->event = RPORT_EV_LOGO; 1270 fc_rport_enter_delete(rdata, RPORT_EV_LOGO);
1271 fc_rport_state_enter(rdata, RPORT_ST_DELETE);
1272 queue_work(rport_event_queue, &rdata->event_work);
1273 1271
1274 lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); 1272 lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
1275 fc_frame_free(fp); 1273 fc_frame_free(fp);