linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "hch@lst.de" <hch@lst.de>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH] block: return NULL in blk_alloc_queue() on error
Date: Sun, 29 Mar 2020 14:10:32 +0200	[thread overview]
Message-ID: <20200329121032.GB5324@lst.de> (raw)
In-Reply-To: <BYAPR04MB496593AEBF503ACC8DD6EFAE86CD0@BYAPR04MB4965.namprd04.prod.outlook.com>

On Sat, Mar 28, 2020 at 11:42:17PM +0000, Chaitanya Kulkarni wrote:
> >> >@@ -555,7 +555,7 @@ struct request_queue *blk_alloc_queue(make_request_fn make_request, int node_id)
> >> >   	struct request_queue *q;
> >> >
> >> >   	if (WARN_ON_ONCE(!make_request))
> >> >-		return -EINVAL;
> >> >+		return NULL;
> > Maybe return ERR_PTR(-EINVAL) is better.
> >
> 
> Initially I used that, what if existing callers are reallying on
> NULL vs !NULL return value ? Use of NULL just makes the code
> consistent with existing return value.
> 
> If Jens is okay with ERR_PTR(), I'll send V2.

The callers can't handle an ERR_PTR, so v1 is correct.

  reply	other threads:[~2020-03-29 12:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 18:27 [PATCH] block: return NULL in blk_alloc_queue() on error Chaitanya Kulkarni
2020-03-28 21:32 ` Guoqing Jiang
2020-03-28 23:42   ` Chaitanya Kulkarni
2020-03-29 12:10     ` hch [this message]
2020-03-29 12:09 ` Christoph Hellwig
2020-03-29 16:08 ` Jens Axboe

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=20200329121032.GB5324@lst.de \
    --to=hch@lst.de \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=linux-block@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 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).