aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIshai Rabinovitz <ishai@mellanox.co.il>2006-07-25 12:54:09 -0400
committerRoland Dreier <rolandd@cisco.com>2006-08-03 12:44:22 -0400
commitd916a8f1b43b358685b1672390ead11f2d3b74c6 (patch)
tree0ba2bd2f211bb95888aa608094610148c5728d3d
parent75df23e229acab85b704f4603bdf5efdc7960e6a (diff)
IB/srp: Fix crash in srp_reconnect_target
Protect against srp_reset_device() clearing the req_queue while srp_reconnect_target() is in progress (note that state change at the top of srp_reconnect_target() is not sufficient for this since srp_reset_device() ignores the state). Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 8f472e7113b4..ff94e4e32691 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -526,8 +526,10 @@ static int srp_reconnect_target(struct srp_target_port *target)
526 while (ib_poll_cq(target->cq, 1, &wc) > 0) 526 while (ib_poll_cq(target->cq, 1, &wc) > 0)
527 ; /* nothing */ 527 ; /* nothing */
528 528
529 spin_lock_irq(target->scsi_host->host_lock);
529 list_for_each_entry_safe(req, tmp, &target->req_queue, list) 530 list_for_each_entry_safe(req, tmp, &target->req_queue, list)
530 srp_reset_req(target, req); 531 srp_reset_req(target, req);
532 spin_unlock_irq(target->scsi_host->host_lock);
531 533
532 target->rx_head = 0; 534 target->rx_head = 0;
533 target->tx_head = 0; 535 target->tx_head = 0;