Skip to content

Commit

Permalink
[SCSI] scsi_error: disable eh_deadline if no host_reset_handler is set
Browse files Browse the repository at this point in the history
When the host template doesn't declare an eh_host_reset_handler
the eh_deadline mechanism is pointless and will set the
device to offline. So disable eh_deadline if no
eh_host_reset_handler is present.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Hannes Reinecke authored and James Bottomley committed Mar 15, 2014
1 parent f2495e2 commit ad469a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
shost->ordered_tag = sht->ordered_tag;
shost->no_write_same = sht->no_write_same;

if (shost_eh_deadline == -1)
if (shost_eh_deadline == -1 || !sht->eh_host_reset_handler)
shost->eh_deadline = -1;
else if ((ulong) shost_eh_deadline * HZ > INT_MAX) {
shost_printk(KERN_WARNING, shost,
Expand Down
4 changes: 3 additions & 1 deletion drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ store_shost_eh_deadline(struct device *dev, struct device_attribute *attr,
int ret = -EINVAL;
unsigned long deadline, flags;

if (shost->transportt && shost->transportt->eh_strategy_handler)
if (shost->transportt &&
(shost->transportt->eh_strategy_handler ||
!shost->hostt->eh_host_reset_handler))
return ret;

if (!strncmp(buf, "off", strlen("off")))
Expand Down

0 comments on commit ad469a5

Please sign in to comment.