Skip to content

Commit

Permalink
[SCSI] libsas: correctly flush the LU queue on error recovery
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Bottomley authored and James Bottomley committed Feb 22, 2008
1 parent 91b5506 commit 63e4563
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/libsas/sas_scsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 63e4563

Please sign in to comment.