linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: "Nadolski, Edmund" <edmund.nadolski@intel.com>
Cc: linux-nvme@lists.infradead.org, Johannes Thumshirn <jthumshirn@suse.de>
Subject: Re: [PATCH 1/2] nvme: remove unused return code from nvme_alloc_ns
Date: Tue, 26 Nov 2019 02:06:44 +0900	[thread overview]
Message-ID: <20191125170644.GA1639@redsun51.ssa.fujisawa.hgst.com> (raw)
In-Reply-To: <221e4352-7fab-abea-9f43-2cd1df60dbaa@intel.com>

On Mon, Nov 25, 2019 at 09:46:08AM -0700, Nadolski, Edmund wrote:
> 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?

It would be informative to just log the error that occurred so we have
something indicating why an expected namespace wasn't created. Otherwise,
I can't think of anything else the caller should do in response to an
error in this path.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-11-25 17:06 UTC|newest]

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
2019-11-25 17:06       ` Keith Busch [this message]
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 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=20191125170644.GA1639@redsun51.ssa.fujisawa.hgst.com \
    --to=kbusch@kernel.org \
    --cc=edmund.nadolski@intel.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-nvme@lists.infradead.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).