diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2014-07-12 12:48:30 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 17:17:03 -0400 |
commit | 56b26e69c8283121febedd12b3cc193384af46b9 (patch) | |
tree | 7e62acbb51256914944320c8aa54111bfbbf663f | |
parent | adb6f9e1a8c6af1037232b59edb11277471537ea (diff) |
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>
-rw-r--r-- | drivers/scsi/storvsc_drv.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 7e8a64251681..2b8595b7ad45 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/device.h> | 33 | #include <linux/device.h> |
34 | #include <linux/hyperv.h> | 34 | #include <linux/hyperv.h> |
35 | #include <linux/mempool.h> | 35 | #include <linux/mempool.h> |
36 | #include <linux/blkdev.h> | ||
36 | #include <scsi/scsi.h> | 37 | #include <scsi/scsi.h> |
37 | #include <scsi/scsi_cmnd.h> | 38 | #include <scsi/scsi_cmnd.h> |
38 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
@@ -1518,6 +1519,16 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) | |||
1518 | return SUCCESS; | 1519 | return SUCCESS; |
1519 | } | 1520 | } |
1520 | 1521 | ||
1522 | /* | ||
1523 | * The host guarantees to respond to each command, although I/O latencies might | ||
1524 | * be unbounded on Azure. Reset the timer unconditionally to give the host a | ||
1525 | * chance to perform EH. | ||
1526 | */ | ||
1527 | static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) | ||
1528 | { | ||
1529 | return BLK_EH_RESET_TIMER; | ||
1530 | } | ||
1531 | |||
1521 | static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) | 1532 | static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) |
1522 | { | 1533 | { |
1523 | bool allowed = true; | 1534 | bool allowed = true; |
@@ -1697,6 +1708,7 @@ static struct scsi_host_template scsi_driver = { | |||
1697 | .bios_param = storvsc_get_chs, | 1708 | .bios_param = storvsc_get_chs, |
1698 | .queuecommand = storvsc_queuecommand, | 1709 | .queuecommand = storvsc_queuecommand, |
1699 | .eh_host_reset_handler = storvsc_host_reset_handler, | 1710 | .eh_host_reset_handler = storvsc_host_reset_handler, |
1711 | .eh_timed_out = storvsc_eh_timed_out, | ||
1700 | .slave_alloc = storvsc_device_alloc, | 1712 | .slave_alloc = storvsc_device_alloc, |
1701 | .slave_destroy = storvsc_device_destroy, | 1713 | .slave_destroy = storvsc_device_destroy, |
1702 | .slave_configure = storvsc_device_configure, | 1714 | .slave_configure = storvsc_device_configure, |