[PATCH 13/14] scsi: virtio_scsi: enable LUN based error handlers

JiangJianJun posted 14 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH 13/14] scsi: virtio_scsi: enable LUN based error handlers
Posted by JiangJianJun 1 month, 2 weeks ago
From: JiangJianJun <jiangjianjun3@h-partners.com>

Enable the virtio_scsi driver to support LUN-based error handlers.
Since virtio_scsi does not define any further reset callbacks,
there is no need to fallback for further recover, so we have
disabled the fallback functionality.

Signed-off-by: JiangJianJun <jiangjianjun3@h-partners.com>
---
 drivers/scsi/virtio_scsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 96a69edddbe5..3c525521351c 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -28,6 +28,7 @@
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_tcq.h>
 #include <scsi/scsi_devinfo.h>
+#include <scsi/scsi_eh.h>
 #include <linux/seqlock.h>
 
 #include "sd.h"
@@ -801,6 +802,8 @@ static const struct scsi_host_template virtscsi_host_template = {
 	.eh_device_reset_handler = virtscsi_device_reset,
 	.eh_timed_out = virtscsi_eh_timed_out,
 	.sdev_init = virtscsi_device_alloc,
+	.sdev_setup_eh = scsi_device_setup_eh,
+	.sdev_clear_eh = scsi_device_clear_eh,
 
 	.dma_boundary = UINT_MAX,
 	.map_queues = virtscsi_map_queues,
-- 
2.33.0