mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
[SCSI] bnx2fc: Fix race condition between IO completion and abort
When IO is successfully completed while an abort is pending, eh_abort incorrectly assumes that abort failed and performes recovery by issuing cleanup. Howerver, cleanup timesout as the firmware has no clue about this IO. Fix this by checking if the IO has already completed. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
parent
c13d2b6d36
commit
5d78f175d0
1 changed files with 5 additions and 2 deletions
|
@ -1270,8 +1270,11 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
|
|||
|
||||
spin_lock_bh(&tgt->tgt_lock);
|
||||
io_req->wait_for_comp = 0;
|
||||
if (!(test_and_set_bit(BNX2FC_FLAG_ABTS_DONE,
|
||||
&io_req->req_flags))) {
|
||||
if (test_bit(BNX2FC_FLAG_IO_COMPL, &io_req->req_flags)) {
|
||||
BNX2FC_IO_DBG(io_req, "IO completed in a different context\n");
|
||||
rc = SUCCESS;
|
||||
} else if (!(test_and_set_bit(BNX2FC_FLAG_ABTS_DONE,
|
||||
&io_req->req_flags))) {
|
||||
/* Let the scsi-ml try to recover this command */
|
||||
printk(KERN_ERR PFX "abort failed, xid = 0x%x\n",
|
||||
io_req->xid);
|
||||
|
|
Loading…
Reference in a new issue