* [patch] scsi_dh_hp_sw.c: return DEV_OFFLINED when blk_get_request fails
@ 2013-03-28 19:32 Jeff Moyer
2013-03-28 19:49 ` Mike Christie
2013-03-28 21:52 ` Joe Lawrence
0 siblings, 2 replies; 3+ messages in thread
From: Jeff Moyer @ 2013-03-28 19:32 UTC (permalink / raw)
To: linux-scsi; +Cc: Joe Lawrence
Hi,
If blk_get_requet fails here, it means that the queue is dead. It seems
better to return a DEV_OFFLINED error code than the misleading
TEMP_UNAVAIL. Comments?
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
index 084062b..eec24d3 100644
--- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c
+++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
@@ -118,7 +118,7 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
retry:
req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO);
if (!req)
- return SCSI_DH_RES_TEMP_UNAVAIL;
+ return SCSI_DH_DEV_OFFLINED;
req->cmd_type = REQ_TYPE_BLOCK_PC;
req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] scsi_dh_hp_sw.c: return DEV_OFFLINED when blk_get_request fails
2013-03-28 19:32 [patch] scsi_dh_hp_sw.c: return DEV_OFFLINED when blk_get_request fails Jeff Moyer
@ 2013-03-28 19:49 ` Mike Christie
2013-03-28 21:52 ` Joe Lawrence
1 sibling, 0 replies; 3+ messages in thread
From: Mike Christie @ 2013-03-28 19:49 UTC (permalink / raw)
To: Jeff Moyer; +Cc: linux-scsi, Joe Lawrence
On 03/28/2013 02:32 PM, Jeff Moyer wrote:
> Hi,
>
> If blk_get_requet fails here, it means that the queue is dead. It seems
> better to return a DEV_OFFLINED error code than the misleading
> TEMP_UNAVAIL. Comments?
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
> index 084062b..eec24d3 100644
> --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c
> +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
> @@ -118,7 +118,7 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
> retry:
> req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO);
> if (!req)
> - return SCSI_DH_RES_TEMP_UNAVAIL;
> + return SCSI_DH_DEV_OFFLINED;
Can we always assume that if using GFP_NOIO then resource allocation
failures will never be returned to us? If so, then the patch is fine. If
not then do we want to base this patch on top of "block: handle pointer
error from blk_get_request" and check the return value. If -ENOMEM then
return SCSI_DH_RES_TEMP_UNAVAIL, and if -ENODEV then return
SCSI_DH_DEV_OFFLINED.
You probably then want to also fix up scsi_dh_alua and scsi_dh_emc the
same way. It looks like they have the same issue.
scsi_dh_emc looks like it has extra errors in that the failure checks
for send_inquiry_cmd do not handle get_req failures properly. It looks
like it ignore them if the senselen is not set.
>
> req->cmd_type = REQ_TYPE_BLOCK_PC;
> req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
> --
> 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] 3+ messages in thread
* Re: [patch] scsi_dh_hp_sw.c: return DEV_OFFLINED when blk_get_request fails
2013-03-28 19:32 [patch] scsi_dh_hp_sw.c: return DEV_OFFLINED when blk_get_request fails Jeff Moyer
2013-03-28 19:49 ` Mike Christie
@ 2013-03-28 21:52 ` Joe Lawrence
1 sibling, 0 replies; 3+ messages in thread
From: Joe Lawrence @ 2013-03-28 21:52 UTC (permalink / raw)
To: Jeff Moyer; +Cc: linux-scsi
On Thu, 28 Mar 2013 15:32:12 -0400
Jeff Moyer <jmoyer@redhat.com> wrote:
> Hi,
>
> If blk_get_requet fails here, it means that the queue is dead. It
> seems better to return a DEV_OFFLINED error code than the misleading
> TEMP_UNAVAIL. Comments?
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c
> b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index 084062b..eec24d3
> 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c
> +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
> @@ -118,7 +118,7 @@ static int hp_sw_tur(struct scsi_device *sdev,
> struct hp_sw_dh_data *h) retry:
> req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO);
> if (!req)
> - return SCSI_DH_RES_TEMP_UNAVAIL;
> + return SCSI_DH_DEV_OFFLINED;
>
> req->cmd_type = REQ_TYPE_BLOCK_PC;
> req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
Hi Jeff,
How about hp_sw_start_stop? It calls blk_get_request with GFP_ATOMIC,
so it might see !req for dead queue or no memory.
-- Joe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-28 21:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 19:32 [patch] scsi_dh_hp_sw.c: return DEV_OFFLINED when blk_get_request fails Jeff Moyer
2013-03-28 19:49 ` Mike Christie
2013-03-28 21:52 ` Joe Lawrence
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.