* [PATCH 1/1] scsi scan: don't fail scans when host is in recovery
@ 2011-08-25 5:36 michaelc
2012-02-22 9:56 ` Hannes Reinecke
0 siblings, 1 reply; 4+ messages in thread
From: michaelc @ 2011-08-25 5:36 UTC (permalink / raw)
To: linux-scsi; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
The problem is that if we are doing a scsi scan then the device goes
into recovery then we will wait for the recovery to complete. It waits
because scsi-ml will send inquiries or report luns and the queueing code
will have been blocked due to the host not being ready. However, if we
are in recovery and then a scan is started the scan will silently fail
and some devices will not be added.
It is easy to hit the problem where devices do not show up with
FC where we are doing tests that disrupt the target controllers.
When the controller is disruprted (reboot, or setting firmware, etc),
and we cause the dev loss tmo to fire then devices will be removed
Then when the problem has been fixed, the rport will be scanned and
devices should be added back. But if we cause another disruption before
scanning has started then devices will not get added back. If the problem
is not started until the scan is started then the devices will be added
back.
This patch fixes that problem by not failing scans when the host
is in recovery. We will let scsi-ml send the IO and let the queueing
and scsi error handling deal with it like is done if we went into
recovery while scanning.
For recovery cases where the host is being torn down then with the
patch we will still fail the scan since there is not point in scanning.
Patch was made and tested over scsi-misc.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
include/scsi/scsi_host.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index f1f2644..22b7b23 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -791,7 +791,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
**/
static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
{
- return shost->shost_state == SHOST_RUNNING;
+ return shost->shost_state == SHOST_RUNNING ||
+ shost->shost_state == SHOST_RECOVERY;
}
extern void scsi_unblock_requests(struct Scsi_Host *);
--
1.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/1] scsi scan: don't fail scans when host is in recovery
2011-08-25 5:36 [PATCH 1/1] scsi scan: don't fail scans when host is in recovery michaelc
@ 2012-02-22 9:56 ` Hannes Reinecke
2012-02-22 20:45 ` Mike Christie
0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2012-02-22 9:56 UTC (permalink / raw)
To: James Bottomley; +Cc: michaelc, linux-scsi
On 08/25/2011 07:36 AM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
>
> The problem is that if we are doing a scsi scan then the device goes
> into recovery then we will wait for the recovery to complete. It waits
> because scsi-ml will send inquiries or report luns and the queueing code
> will have been blocked due to the host not being ready. However, if we
> are in recovery and then a scan is started the scan will silently fail
> and some devices will not be added.
>
> It is easy to hit the problem where devices do not show up with
> FC where we are doing tests that disrupt the target controllers.
> When the controller is disruprted (reboot, or setting firmware, etc),
> and we cause the dev loss tmo to fire then devices will be removed
> Then when the problem has been fixed, the rport will be scanned and
> devices should be added back. But if we cause another disruption before
> scanning has started then devices will not get added back. If the problem
> is not started until the scan is started then the devices will be added
> back.
>
> This patch fixes that problem by not failing scans when the host
> is in recovery. We will let scsi-ml send the IO and let the queueing
> and scsi error handling deal with it like is done if we went into
> recovery while scanning.
>
> For recovery cases where the host is being torn down then with the
> patch we will still fail the scan since there is not point in scanning.
>
> Patch was made and tested over scsi-misc.
>
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> ---
> include/scsi/scsi_host.h | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
> index f1f2644..22b7b23 100644
> --- a/include/scsi/scsi_host.h
> +++ b/include/scsi/scsi_host.h
> @@ -791,7 +791,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
> **/
> static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
> {
> - return shost->shost_state == SHOST_RUNNING;
> + return shost->shost_state == SHOST_RUNNING ||
> + shost->shost_state == SHOST_RECOVERY;
> }
>
> extern void scsi_unblock_requests(struct Scsi_Host *);
James, ping?
Any reason it was not included?
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 1/1] scsi scan: don't fail scans when host is in recovery
2012-02-22 9:56 ` Hannes Reinecke
@ 2012-02-22 20:45 ` Mike Christie
2012-02-23 7:21 ` Hannes Reinecke
0 siblings, 1 reply; 4+ messages in thread
From: Mike Christie @ 2012-02-22 20:45 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: James Bottomley, linux-scsi
On 02/22/2012 03:56 AM, Hannes Reinecke wrote:
>> ---
>> include/scsi/scsi_host.h | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
>> index f1f2644..22b7b23 100644
>> --- a/include/scsi/scsi_host.h
>> +++ b/include/scsi/scsi_host.h
>> @@ -791,7 +791,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
>> **/
>> static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
>> {
>> - return shost->shost_state == SHOST_RUNNING;
>> + return shost->shost_state == SHOST_RUNNING ||
>> + shost->shost_state == SHOST_RECOVERY;
>> }
>>
>> extern void scsi_unblock_requests(struct Scsi_Host *);
>
> James, ping?
> Any reason it was not included?
>
It is merged in git commit 76e4e12ff2b3ef86773989fd897b194eb38016e6.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 1/1] scsi scan: don't fail scans when host is in recovery
2012-02-22 20:45 ` Mike Christie
@ 2012-02-23 7:21 ` Hannes Reinecke
0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2012-02-23 7:21 UTC (permalink / raw)
To: Mike Christie; +Cc: James Bottomley, linux-scsi
On 02/22/2012 09:45 PM, Mike Christie wrote:
> On 02/22/2012 03:56 AM, Hannes Reinecke wrote:
>>> ---
>>> include/scsi/scsi_host.h | 3 ++-
>>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
>>> index f1f2644..22b7b23 100644
>>> --- a/include/scsi/scsi_host.h
>>> +++ b/include/scsi/scsi_host.h
>>> @@ -791,7 +791,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
>>> **/
>>> static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
>>> {
>>> - return shost->shost_state == SHOST_RUNNING;
>>> + return shost->shost_state == SHOST_RUNNING ||
>>> + shost->shost_state == SHOST_RECOVERY;
>>> }
>>>
>>> extern void scsi_unblock_requests(struct Scsi_Host *);
>>
>> James, ping?
>> Any reason it was not included?
>>
>
> It is merged in git commit 76e4e12ff2b3ef86773989fd897b194eb38016e6.
I must be blind
Sorry for the noise.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-23 7:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 5:36 [PATCH 1/1] scsi scan: don't fail scans when host is in recovery michaelc
2012-02-22 9:56 ` Hannes Reinecke
2012-02-22 20:45 ` Mike Christie
2012-02-23 7:21 ` Hannes Reinecke
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).