From: Hannes Reinecke <hare@suse.de>
To: emilne@redhat.com
Cc: James Bottomley <jbottomley@parallels.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi_error: disable eh_deadline if no host_reset_handler is set
Date: Fri, 17 Jan 2014 16:04:25 +0100 [thread overview]
Message-ID: <52D94679.4010408@suse.de> (raw)
In-Reply-To: <1389101625.3817.1042.camel@localhost.localdomain>
On 01/07/2014 02:33 PM, Ewan Milne wrote:
> On Thu, 2013-12-12 at 12:08 +0100, Hannes Reinecke wrote:
>> 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.
>>
>> Cc: Ewan Milne <emilne@redhat.com>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>> drivers/scsi/hosts.c | 2 +-
>> drivers/scsi/scsi_sysfs.c | 4 +++-
>> 2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
>> index 6966def..351afa4 100644
>> --- a/drivers/scsi/hosts.c
>> +++ b/drivers/scsi/hosts.c
>> @@ -396,7 +396,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
>> shost->unchecked_isa_dma = sht->unchecked_isa_dma;
>> shost->use_clustering = sht->use_clustering;
>> shost->ordered_tag = sht->ordered_tag;
>> - 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,
>> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
>> index 9117d0b..7434e26 100644
>> --- a/drivers/scsi/scsi_sysfs.c
>> +++ b/drivers/scsi/scsi_sysfs.c
>> @@ -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->transportt->eh_host_reset_handler))
>
> I think this bit is supposed to be:
>
> if ((shost->transportt &&
> shost->transportt->eh_strategy_handler) ||
> !shost->hostt->eh_host_reset_handler)
> return ret;
>
> because the field is in the scsi_host_template structure, right?
>
Right. Obviously.
I'll be sending an updated patch.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +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-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-01-17 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-12 11:08 [PATCH] scsi_error: disable eh_deadline if no host_reset_handler is set Hannes Reinecke
2014-01-07 13:33 ` Ewan Milne
2014-01-17 15:04 ` Hannes Reinecke [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-01-17 15:05 Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52D94679.4010408@suse.de \
--to=hare@suse.de \
--cc=emilne@redhat.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).