]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] libsas: correctly flush the LU queue on error recovery
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 22 Feb 2008 23:07:52 +0000 (17:07 -0600)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 22 Feb 2008 23:23:47 +0000 (17:23 -0600)
The current sas_scsi_clear_queue_lu() is wrongly checking for commands
which match the pointer to the one passed in.  It should be checking for
commands which are on the same logical unit as the one passed in.  Fix
this by checking target pointer and LUN for equality.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/libsas/sas_scsi_host.c

index 9c96d1bd36e240221fae332e81116bf1fc8b813b..704ea06a6e500a8d3bfd25179dc9efa73791c655 100644 (file)
@@ -280,7 +280,8 @@ static void sas_scsi_clear_queue_lu(struct list_head *error_q, struct scsi_cmnd
        struct scsi_cmnd *cmd, *n;
 
        list_for_each_entry_safe(cmd, n, error_q, eh_entry) {
-               if (cmd == my_cmd)
+               if (cmd->device->sdev_target == my_cmd->device->sdev_target &&
+                   cmd->device->lun == my_cmd->device->lun)
                        sas_eh_finish_cmd(cmd);
        }
 }