On 23/05/13 23:09, Joe Lawrence wrote:
> Hi Jens,
> 
> Subject: [PATCH v4] block: handle pointer error from blk_get_request
> 
> The blk_get_request function may fail in low-memory conditions or during
> device removal (even if __GFP_WAIT is set). To distinguish between these
> errors, modify the blk_get_request call stack to return the appropriate
> error pointer. Verify that all callers check the return status and
> consider IS_ERR instead of a simple NULL pointer check.
> 
> Signed-off-by: Joe Lawrence <joe.lawre...@stratus.com>
> Cc: Jens Axboe <ax...@kernel.dk>
> Cc: "James E.J. Bottomley" <jbottom...@parallels.com>
> Cc: Bart Van Assche <bvanass...@acm.org>
> Cc: linux-scsi@vger.kernel.org

ACK-by: Boaz Harrosh <bharr...@panasas.com>

> ---
<>
>  drivers/scsi/osd/osd_initiator.c            |  4 ++--
<>
> diff --git a/drivers/scsi/osd/osd_initiator.c 
> b/drivers/scsi/osd/osd_initiator.c
> index d8293f2..b4cd56b 100644
> --- a/drivers/scsi/osd/osd_initiator.c
> +++ b/drivers/scsi/osd/osd_initiator.c
> @@ -1567,8 +1567,8 @@ static struct request *_make_request(struct 
> request_queue *q, bool has_write,
>               struct request *req;
>  
>               req = blk_get_request(q, has_write ? WRITE : READ, flags);
> -             if (unlikely(!req))
> -                     return ERR_PTR(-ENOMEM);
> +             if (unlikely(IS_ERR(req)))
> +                     return req;
>  
>               return req;
>       }


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to