scsi_error: really disable eh_deadline if no host_reset_handler is set
PATCH 1/1 scsi_error: really disable eh_deadline if no host_reset_handler is set
From: "Ewan D. Milne" <[email protected]>
Commit 0d860641db6d49655b91cd08c8db5af74f88bcb5 ("disable eh_deadline if no host_reset_handler is set") did not prevent eh_deadline from being set via sysfs if shost->transportt was NULL. That logic is incorrect.
The logic should prevent setting eh_deadline if:
- A transport-specific eh_strategy_handler is provided
or
- The host driver has no eh_reset_handler
...because the eh_deadline value won't be used if a different EH strategy is provided, and won't work properly if the host can't be reset when the deadline expires.
Signed-off-by Ewan D. Milne <[email protected]>
--- drivers/scsi/scsi_sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/scsi_sysfs.c +3 -3
@@ -300,9 +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 || - !shost->hostt->eh_host_reset_handler)) +if ((shost->transportt && + shost->transportt->eh_strategy_handler) || + !shost->hostt->eh_host_reset_handler)return ret;if (!strncmp (buf,"off" ,strlen ("off" )))
Signature · 1 line
1.7.11.7