diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-10 01:10:48 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-10 06:50:46 -0500 |
commit | f29841e08fa20a7f2c8bc1b70306975299c66ee7 (patch) | |
tree | c2f6c87cf79fbd36ec49ea3c2247a382da5d75cc /include/linux/libata.h | |
parent | 341963b909a01d2f38d86f5db8dd1f8c80bd6dbf (diff) |
[PATCH] libata: implement ata_scsi_timed_out()
Implement ata_scsi_timed_out(), to be used as
scsi_host_template->eh_timed_out callback for all libata drivers.
Without this function, the following race exists.
If a qc completes after SCSI timer expires but before libata EH kicks
in, the qc gets completed but the scsicmd still gets passed to libata
EH resulting in ->eng_timeout invocation with NULL qc, which none is
handling properly.
This patch makes sure that scmd and qc share the same lifetime.
Original idea from Jeff Garzik <jgarzik@pobox.com>.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5c70a57f93ee..c1e198655bb1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -509,6 +509,7 @@ extern void ata_host_set_remove(struct ata_host_set *host_set); | |||
509 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 509 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
510 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 510 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
511 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 511 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
512 | extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); | ||
512 | extern int ata_scsi_error(struct Scsi_Host *host); | 513 | extern int ata_scsi_error(struct Scsi_Host *host); |
513 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | 514 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); |
514 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | 515 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); |