aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2013-03-08 16:28:52 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 10:32:25 -0400
commit5d78f175d0983de8dc0010fcc7c8afc777d4b8ee (patch)
treec9f651d4339142448f3168e96c6d1f01395edb3e
parentc13d2b6d3640d1ef180e40191178b4f1271982c1 (diff)
[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>
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 723a9a8ba5ee..e80ca01af8b4 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1270,8 +1270,11 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
1270 1270
1271 spin_lock_bh(&tgt->tgt_lock); 1271 spin_lock_bh(&tgt->tgt_lock);
1272 io_req->wait_for_comp = 0; 1272 io_req->wait_for_comp = 0;
1273 if (!(test_and_set_bit(BNX2FC_FLAG_ABTS_DONE, 1273 if (test_bit(BNX2FC_FLAG_IO_COMPL, &io_req->req_flags)) {
1274 &io_req->req_flags))) { 1274 BNX2FC_IO_DBG(io_req, "IO completed in a different context\n");
1275 rc = SUCCESS;
1276 } else if (!(test_and_set_bit(BNX2FC_FLAG_ABTS_DONE,
1277 &io_req->req_flags))) {
1275 /* Let the scsi-ml try to recover this command */ 1278 /* Let the scsi-ml try to recover this command */
1276 printk(KERN_ERR PFX "abort failed, xid = 0x%x\n", 1279 printk(KERN_ERR PFX "abort failed, xid = 0x%x\n",
1277 io_req->xid); 1280 io_req->xid);