aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-04-19 14:40:10 -0400
committerRoland Dreier <rolandd@cisco.com>2006-04-19 14:40:10 -0400
commitf80887d0b9e1af481dc4a30fc145dfed24ddfd59 (patch)
treea928a8469193981b7df4df4db8c16baa44da4fd8 /drivers/infiniband
parent0efd9323f32c137b5cf48bc6582cd08556e7cdfc (diff)
IB/srp: Remove request from list when SCSI abort succeeds
If a SCSI abort succeeds, then the aborted request should to be removed from the list of pending requests. This fixes list corruption after an abort occurs. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 5f2b3f6e4c47..5bb55742ada6 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -617,6 +617,14 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
617 scmnd->sc_data_direction); 617 scmnd->sc_data_direction);
618} 618}
619 619
620static void srp_remove_req(struct srp_target_port *target, struct srp_request *req,
621 int index)
622{
623 list_del(&req->list);
624 req->next = target->req_head;
625 target->req_head = index;
626}
627
620static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) 628static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp)
621{ 629{
622 struct srp_request *req; 630 struct srp_request *req;
@@ -664,9 +672,7 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp)
664 scmnd->host_scribble = (void *) -1L; 672 scmnd->host_scribble = (void *) -1L;
665 scmnd->scsi_done(scmnd); 673 scmnd->scsi_done(scmnd);
666 674
667 list_del(&req->list); 675 srp_remove_req(target, req, rsp->tag & ~SRP_TAG_TSK_MGMT);
668 req->next = target->req_head;
669 target->req_head = rsp->tag & ~SRP_TAG_TSK_MGMT;
670 } else 676 } else
671 req->cmd_done = 1; 677 req->cmd_done = 1;
672 } 678 }
@@ -1188,12 +1194,10 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func)
1188 spin_lock_irq(target->scsi_host->host_lock); 1194 spin_lock_irq(target->scsi_host->host_lock);
1189 1195
1190 if (req->cmd_done) { 1196 if (req->cmd_done) {
1191 list_del(&req->list); 1197 srp_remove_req(target, req, req_index);
1192 req->next = target->req_head;
1193 target->req_head = req_index;
1194
1195 scmnd->scsi_done(scmnd); 1198 scmnd->scsi_done(scmnd);
1196 } else if (!req->tsk_status) { 1199 } else if (!req->tsk_status) {
1200 srp_remove_req(target, req, req_index);
1197 scmnd->result = DID_ABORT << 16; 1201 scmnd->result = DID_ABORT << 16;
1198 ret = SUCCESS; 1202 ret = SUCCESS;
1199 } 1203 }