mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
scsi: virtio_scsi: let host do exception handling
virtio_scsi tries to do exception handling after the default 30 seconds timeout expires. However, it's better to let the host control the timeout, otherwise with a heavy I/O load it is likely that an abort will also timeout. This leads to fatal errors like filesystems going offline. Disable the 'sd' timeout and allow the host to do exception handling, following the precedent of the storvsc driver. Hannes has a proposal to introduce timeouts in virtio, but this provides an immediate solution for stable kernels too. [mkp: fixed typo] Reported-by: Douglas Miller <dougmill@linux.vnet.ibm.com> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Hannes Reinecke <hare@suse.de> Cc: linux-scsi@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
49541a04b1
commit
e72c9a2a67
1 changed files with 12 additions and 0 deletions
|
@ -795,6 +795,16 @@ static int virtscsi_map_queues(struct Scsi_Host *shost)
|
||||||
return blk_mq_virtio_map_queues(&shost->tag_set, vscsi->vdev, 2);
|
return blk_mq_virtio_map_queues(&shost->tag_set, vscsi->vdev, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The host guarantees to respond to each command, although I/O
|
||||||
|
* latencies might be higher than on bare metal. Reset the timer
|
||||||
|
* unconditionally to give the host a chance to perform EH.
|
||||||
|
*/
|
||||||
|
static enum blk_eh_timer_return virtscsi_eh_timed_out(struct scsi_cmnd *scmnd)
|
||||||
|
{
|
||||||
|
return BLK_EH_RESET_TIMER;
|
||||||
|
}
|
||||||
|
|
||||||
static struct scsi_host_template virtscsi_host_template_single = {
|
static struct scsi_host_template virtscsi_host_template_single = {
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.name = "Virtio SCSI HBA",
|
.name = "Virtio SCSI HBA",
|
||||||
|
@ -805,6 +815,7 @@ static struct scsi_host_template virtscsi_host_template_single = {
|
||||||
.change_queue_depth = virtscsi_change_queue_depth,
|
.change_queue_depth = virtscsi_change_queue_depth,
|
||||||
.eh_abort_handler = virtscsi_abort,
|
.eh_abort_handler = virtscsi_abort,
|
||||||
.eh_device_reset_handler = virtscsi_device_reset,
|
.eh_device_reset_handler = virtscsi_device_reset,
|
||||||
|
.eh_timed_out = virtscsi_eh_timed_out,
|
||||||
.slave_alloc = virtscsi_device_alloc,
|
.slave_alloc = virtscsi_device_alloc,
|
||||||
|
|
||||||
.can_queue = 1024,
|
.can_queue = 1024,
|
||||||
|
@ -825,6 +836,7 @@ static struct scsi_host_template virtscsi_host_template_multi = {
|
||||||
.change_queue_depth = virtscsi_change_queue_depth,
|
.change_queue_depth = virtscsi_change_queue_depth,
|
||||||
.eh_abort_handler = virtscsi_abort,
|
.eh_abort_handler = virtscsi_abort,
|
||||||
.eh_device_reset_handler = virtscsi_device_reset,
|
.eh_device_reset_handler = virtscsi_device_reset,
|
||||||
|
.eh_timed_out = virtscsi_eh_timed_out,
|
||||||
|
|
||||||
.can_queue = 1024,
|
.can_queue = 1024,
|
||||||
.dma_boundary = UINT_MAX,
|
.dma_boundary = UINT_MAX,
|
||||||
|
|
Loading…
Reference in a new issue