Linux-NVME Archive on
 help / color / Atom feed
From: "Nadolski, Edmund" <>
To: Johannes Thumshirn <>,
	Edmund Nadolski <>,,
Subject: Re: [PATCH 1/2] nvme: remove unused return code from nvme_alloc_ns
Date: Mon, 25 Nov 2019 09:46:08 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On 11/25/2019 9:09 AM, Johannes Thumshirn wrote:
> On 25/11/2019 17:06, Edmund Nadolski wrote:
>> The return code of nvme_alloc_ns is never used, so change it
>> to void.
> Oh no, please do it the other way round, check the return value of
> nvme_alloc_ns() and handle error properly.
> nvme_alloc_ns() is doing memory allocations and these can fail (although
> less likely because of the GFP_KERNEL allocations).

I considered that, tho it looked to me like the caller (nvme_validate_ns) and 
its callers (nvme_scan_ns_list, nvme_scan_ns_sequential) don't really care, 
and intend simply to continue on regardless of memory alloc failure(s).

I can either add the -ENOMEM handling, or clarify the caller's intent w/some 
comments. Which is the way to go?


linux-nvme mailing list

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 16:06 [PATCH 0/2] A few code cleanups Edmund Nadolski
2019-11-25 16:06 ` [PATCH 1/2] nvme: remove unused return code from nvme_alloc_ns Edmund Nadolski
2019-11-25 16:09   ` Johannes Thumshirn
2019-11-25 16:46     ` Nadolski, Edmund [this message]
2019-11-25 17:06       ` Keith Busch
2019-11-26  4:01         ` Chaitanya Kulkarni
2019-11-26 16:47           ` Christoph Hellwig
2019-11-25 16:06 ` [PATCH 2/2] nvme: else following return is not needed Edmund Nadolski
2019-11-26 16:48   ` Christoph Hellwig
2019-11-26 17:38     ` Keith Busch

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NVME Archive on

Archives are clonable:
	git clone --mirror linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ \
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone