• Tejun Heo's avatar
    [PATCH] libata: implement ata_scsi_timed_out() · f29841e0
    Tejun Heo authored
    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: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
    f29841e0
libata-scsi.c 67.1 KB