[PATCH 2.6.18-rc6-mm1] ieee1394: sbp2: slightly reorder sbp2scsi_abort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Put the target's fetch agent into reset state before the underlying ORB
DMA is unmapped and the ->done handler is called.  It is highly unlikely
but the target could access that ORB right before sbp2 sends the reset
request.

Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
---
Index: linux/drivers/ieee1394/sbp2.c
===================================================================
--- linux.orig/drivers/ieee1394/sbp2.c	2006-09-08 20:07:44.000000000 +0200
+++ linux/drivers/ieee1394/sbp2.c	2006-09-11 20:00:24.000000000 +0200
@@ -2560,11 +2560,9 @@ static int sbp2scsi_abort(struct scsi_cm
 	scsi_print_command(SCpnt);
 
 	if (sbp2util_node_is_available(scsi_id)) {
+		sbp2_agent_reset(scsi_id, 1);
 
-		/*
-		 * Right now, just return any matching command structures
-		 * to the free pool.
-		 */
+		/* Return a matching command structure to the free pool. */
 		spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
 		command = sbp2util_find_command_for_SCpnt(scsi_id, SCpnt);
 		if (command) {
@@ -2585,10 +2583,6 @@ static int sbp2scsi_abort(struct scsi_cm
 		}
 		spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags);
 
-		/*
-		 * Initiate a fetch agent reset.
-		 */
-		sbp2_agent_reset(scsi_id, 1);
 		sbp2scsi_complete_all_commands(scsi_id, DID_BUS_BUSY);
 	}
 


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux