]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/drivers-scsi-storvsc-implement-a-eh_timed_out-handler.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / drivers-scsi-storvsc-implement-a-eh_timed_out-handler.patch
1 From 56b26e69c8283121febedd12b3cc193384af46b9 Mon Sep 17 00:00:00 2001
2 From: "K. Y. Srinivasan" <kys@microsoft.com>
3 Date: Sat, 12 Jul 2014 09:48:30 -0700
4 Subject: Drivers: scsi: storvsc: Implement a eh_timed_out handler
5
6 From: "K. Y. Srinivasan" <kys@microsoft.com>
7
8 commit 56b26e69c8283121febedd12b3cc193384af46b9 upstream.
9
10 On Azure, we have seen instances of unbounded I/O latencies. To deal with
11 this issue, implement handler that can reset the timeout. Note that the
12 host gaurantees that it will respond to each command that has been issued.
13
14 Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
15 Reviewed-by: Hannes Reinecke <hare@suse.de>
16 [hch: added a better comment explaining the issue]
17 Signed-off-by: Christoph Hellwig <hch@lst.de>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/scsi/storvsc_drv.c | 12 ++++++++++++
22 1 file changed, 12 insertions(+)
23
24 --- a/drivers/scsi/storvsc_drv.c
25 +++ b/drivers/scsi/storvsc_drv.c
26 @@ -33,6 +33,7 @@
27 #include <linux/device.h>
28 #include <linux/hyperv.h>
29 #include <linux/mempool.h>
30 +#include <linux/blkdev.h>
31 #include <scsi/scsi.h>
32 #include <scsi/scsi_cmnd.h>
33 #include <scsi/scsi_host.h>
34 @@ -1518,6 +1519,16 @@ static int storvsc_host_reset_handler(st
35 return SUCCESS;
36 }
37
38 +/*
39 + * The host guarantees to respond to each command, although I/O latencies might
40 + * be unbounded on Azure. Reset the timer unconditionally to give the host a
41 + * chance to perform EH.
42 + */
43 +static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd)
44 +{
45 + return BLK_EH_RESET_TIMER;
46 +}
47 +
48 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
49 {
50 bool allowed = true;
51 @@ -1687,6 +1698,7 @@ static struct scsi_host_template scsi_dr
52 .bios_param = storvsc_get_chs,
53 .queuecommand = storvsc_queuecommand,
54 .eh_host_reset_handler = storvsc_host_reset_handler,
55 + .eh_timed_out = storvsc_eh_timed_out,
56 .slave_alloc = storvsc_device_alloc,
57 .slave_destroy = storvsc_device_destroy,
58 .slave_configure = storvsc_device_configure,