With the following patch applied my ia64 system does not crash anymore

I prepare this patch diffing from srp revision 6455 applied with srp-params.patch that I sent you last week

Please let me know if you want this patch generated from current srp (revision 6550)

What is the status for srp-params.patch (introducing tuned parameters)

Sorry. The previous patch is generated in reversed order


diff -Nau srp.6455.tuned_params/ib_srp.c srp/ib_srp.c
--- srp.6455.tuned_params/ib_srp.c	2006-04-21 15:00:28.000000000 -0700
+++ srp/ib_srp.c	2006-04-21 14:51:52.000000000 -0700
@@ -80,6 +80,9 @@
 static void srp_remove_one(struct ib_device *device);
 static void srp_completion(struct ib_cq *cq, void *target_ptr);
 static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event);
+static void srp_unmap_data(struct scsi_cmnd *scmnd,
+			   struct srp_target_port *target,
+			   struct srp_request *req);
 
 static struct ib_client srp_client = {
 	.name   = "srp",
@@ -459,6 +462,8 @@
 		; /* nothing */
 
 	list_for_each_entry(req, &target->req_queue, list) {
+		srp_unmap_data(req->scmnd, target, req);
+
 		req->scmnd->result = DID_RESET << 16;
 		req->scmnd->scsi_done(req->scmnd);
 	}
@@ -1195,15 +1200,24 @@
 
 	spin_unlock_irq(target->scsi_host->host_lock);
 	if (!wait_for_completion_timeout(&req->done,
-					 msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS)))
+					 msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS))) {
+		if (func == SRP_TSK_ABORT_TASK) {
+			srp_unmap_data(scmnd, target, req);
+			srp_remove_req(target, req, req_index);
+		}
 		return FAILED;
+	}
 	spin_lock_irq(target->scsi_host->host_lock);
 
-	if (req->cmd_done) {
+	if ((req->cmd_done) && (func == SRP_TSK_ABORT_TASK)) {
+		srp_unmap_data(scmnd, target, req);
 		srp_remove_req(target, req, req_index);
 		scmnd->scsi_done(scmnd);
 	} else if (!req->tsk_status) {
-		srp_remove_req(target, req, req_index);
+		if (func == SRP_TSK_ABORT_TASK) {
+			srp_unmap_data(scmnd, target, req);
+			srp_remove_req(target, req, req_index);
+		}
 		scmnd->result = DID_ABORT << 16;
 		ret = SUCCESS;
 	}
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to