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,
	"David S. Miller" <davem@davemloft.net>,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	"Kai Mäkisara" <Kai.Makisara@kolumbus.fi>,
	"Benny Halevy" <bhalevy@tonian.com>,
	"Doug Gilbert" <dgilbert@interlog.com>,
	"FUJITA Tomonori" <fujita.tomonori@lab.ntt.co.jp>,
	"Jens Axboe" <axboe@kernel.dk>, "Jiri Kosina" <jkosina@suse.cz>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Tim Waugh" <tim@cyberelk.net>, "Willem Riede" <osst@riede.org>
Subject: Re: [PATCH v6 2/2] block,scsi: convert and handle ERR_PTR from  blk_get_request
Date: Mon, 4 Nov 2013 15:41:25 +0200	[thread overview]
Message-ID: <5277A405.706@panasas.com> (raw)
In-Reply-To: <1383227434-4536-3-git-send-email-joe.lawrence@stratus.com>

On 10/31/2013 03:50 PM, Joe Lawrence wrote:
> 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
> ERR_PTR. 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>
> ---
<>
> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
> index aa66361ed44b..0250efda647b 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)))

Just a nit IS_ERR already has an unlikely so it can be dropped here. (No bigy)

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

> +			return req;
>  
>  		return req;
>  	}
<>

Thanks
Boaz


      reply	other threads:[~2013-11-04 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 13:50 [PATCH v6 2/2] block,scsi: convert and handle ERR_PTR from blk_get_request Joe Lawrence
2013-11-04 13:41 ` Boaz Harrosh [this message]

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=5277A405.706@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=JBottomley@parallels.com \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=axboe@kernel.dk \
    --cc=bhalevy@tonian.com \
    --cc=davem@davemloft.net \
    --cc=dgilbert@interlog.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jkosina@suse.cz \
    --cc=joe.lawrence@stratus.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osst@riede.org \
    --cc=pbonzini@redhat.com \
    --cc=tim@cyberelk.net \
    /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.