All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Joe Lawrence <joe.lawrence@stratus.com>
Cc: linux-scsi@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH v4] block: handle pointer error from blk_get_request
Date: Thu, 23 May 2013 23:24:47 +0300	[thread overview]
Message-ID: <519E7B0F.9050604@panasas.com> (raw)
In-Reply-To: <20130523160940.23dc4aee@jlaw-desktop.mno.stratus.com>

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.lawrence@stratus.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
> Cc: Bart Van Assche <bvanassche@acm.org>
> Cc: linux-scsi@vger.kernel.org

ACK-by: Boaz Harrosh <bharrosh@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;
>  	}



  reply	other threads:[~2013-05-23 20:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17 17:32 [PATCH] block,scsi: verify return pointer from blk_get_request Joe Lawrence
2013-03-17 22:44 ` Jens Axboe
2013-05-23 20:40   ` James Bottomley
2013-05-23 21:37     ` Joe Lawrence
2013-03-19 13:55 ` Bart Van Assche
2013-03-26 19:06 ` [PATCH v2] block: handle pointer error " Joe Lawrence
2013-03-26 22:34   ` [PATCH v3] " Joe Lawrence
2013-05-23 20:09     ` [PATCH v4] " Joe Lawrence
2013-05-23 20:24       ` Boaz Harrosh [this message]
2013-05-24 18:15 ` [PATCH v5 0/2] block,scsi: fixup blk_get_request dead queue scenarios Joe Lawrence
2013-05-24 18:16   ` [PATCH v5 1/2] block,scsi: verify return pointer from blk_get_request Joe Lawrence
2013-05-27 14:42     ` Jiri Kosina
2013-05-24 18:17   ` [PATCH v5 2/2] block,scsi: convert and handle ERR_PTR " Joe Lawrence
2013-05-27 14:42     ` Jiri Kosina
2013-07-24 14:29   ` [PATCH v5 0/2] block,scsi: fixup blk_get_request dead queue scenarios Joe Lawrence

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=519E7B0F.9050604@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=JBottomley@parallels.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=joe.lawrence@stratus.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 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.