Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Drivers: scsi: storvsc: Implement a eh_timed_out handler

On Azure, we have seen instances of unbounded I/O latencies. To deal with
this issue, implement handler that can reset the timeout. Note that the
host gaurantees that it will respond to each command that has been issued.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: <stable@vger.kernel.org>
[hch: added a better comment explaining the issue]
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

K. Y. Srinivasan and committed by
Christoph Hellwig
56b26e69 adb6f9e1

+12
+12
drivers/scsi/storvsc_drv.c
··· 33 33 #include <linux/device.h> 34 34 #include <linux/hyperv.h> 35 35 #include <linux/mempool.h> 36 + #include <linux/blkdev.h> 36 37 #include <scsi/scsi.h> 37 38 #include <scsi/scsi_cmnd.h> 38 39 #include <scsi/scsi_host.h> ··· 1519 1518 return SUCCESS; 1520 1519 } 1521 1520 1521 + /* 1522 + * The host guarantees to respond to each command, although I/O latencies might 1523 + * be unbounded on Azure. Reset the timer unconditionally to give the host a 1524 + * chance to perform EH. 1525 + */ 1526 + static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) 1527 + { 1528 + return BLK_EH_RESET_TIMER; 1529 + } 1530 + 1522 1531 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) 1523 1532 { 1524 1533 bool allowed = true; ··· 1708 1697 .bios_param = storvsc_get_chs, 1709 1698 .queuecommand = storvsc_queuecommand, 1710 1699 .eh_host_reset_handler = storvsc_host_reset_handler, 1700 + .eh_timed_out = storvsc_eh_timed_out, 1711 1701 .slave_alloc = storvsc_device_alloc, 1712 1702 .slave_destroy = storvsc_device_destroy, 1713 1703 .slave_configure = storvsc_device_configure,