Re: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler
From: Hannes Reinecke
Date: Fri Jul 11 2014 - 05:53:03 EST
On 07/11/2014 12:26 AM, KY Srinivasan wrote:
-----Original Message-----
From: Christoph Hellwig [mailto:hch@xxxxxxxxxxxxx]
Sent: Thursday, July 10, 2014 3:13 AM
To: KY Srinivasan
Cc: Christoph Hellwig; linux-kernel@xxxxxxxxxxxxxxx;
devel@xxxxxxxxxxxxxxxxxxxxxx; ohering@xxxxxxxx;
jbottomley@xxxxxxxxxxxxx; jasowang@xxxxxxxxxx; apw@xxxxxxxxxxxxx;
linux-scsi@xxxxxxxxxxxxxxx
Subject: Re: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler
Note that you could increase the timeout and/or implement an
eh_timed_out handler that just returns BLK_EH_RESET_TIMER, but if the
completion takes too long the expectation is that a command will eventually
finish instead of beeing delayed by an unmound amount.
I like this idea; I will implement a eh_timed_out_handler.
Something like this should be sufficient:
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e71a0d7..630ae81 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1468,6 +1468,12 @@ static int storvsc_get_chs(struct scsi_device
*sdev, stru
ct block_device * bdev,
return 0;
}
+static enum blk_eh_timer_return
+storvsc_timed_out_handler(struct scsi_cmnd *scmd)
+{
+ return BLK_EH_RESET_TIMER;
+}
+
static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
{
struct hv_host_device *host_dev =
shost_priv(scmnd->device->host);
@@ -1687,6 +1693,7 @@ static struct scsi_host_template scsi_driver = {
.name = "storvsc_host_t",
.bios_param = storvsc_get_chs,
.queuecommand = storvsc_queuecommand,
+ .eh_timed_out = storvsc_timed_out_handler,
.eh_host_reset_handler = storvsc_host_reset_handler,
.slave_alloc = storvsc_device_alloc,
.slave_destroy = storvsc_device_destroy,
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@xxxxxxx +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/