Skip to content

Commit

Permalink
[SCSI] libfc: fix rport event race between READY and LOGO
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Sep 10, 2009
1 parent 9e9d045 commit 00fea93
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/scsi/libfc/fc_rport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,9 +1267,7 @@ static void fc_rport_recv_logo_req(struct fc_rport_priv *rdata,
return;
}

rdata->event = RPORT_EV_LOGO;
fc_rport_state_enter(rdata, RPORT_ST_DELETE);
queue_work(rport_event_queue, &rdata->event_work);
fc_rport_enter_delete(rdata, RPORT_EV_LOGO);

lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
fc_frame_free(fp);
Expand Down

0 comments on commit 00fea93

Please sign in to comment.