From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH rfc v2 3/6] nvme: make nvme_identify_ns propagate errors back
Date: Tue, 6 Aug 2019 08:33:21 +0200 [thread overview]
Message-ID: <0d57a9e7-b375-e669-a32d-76a517c36319@suse.de> (raw)
In-Reply-To: <87055a67-3411-c31b-8fc8-7652d0fe4f5a@grimberg.me>
On 8/5/19 8:18 PM, Sagi Grimberg wrote:
>
>> I'd prefer using PTR_ERR() here; that would avoid the **id parameter.
>> (I'm really biased against this calling model, returning an error _and_
>> a structure.
>
> I can do that, shouldn't be a problem.
>
>> You can never be sure that both match, and you always get
>> into weird error handling routines.)
>
> Well, the semantics is clear. If the call succeeded, id was allocated
> and if not, id wasn't allocated. Not sure how this is confusing or
> weird.
>
... In theory, yes. But there is no implicit guarantee that this is the
case; you always have _two_ return values which might be conflicting.
Hence I prefer the PTR_ERR() approach; that way we'll only ever having
one return value.
(Plus it'll be easier for me to backport :-)
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare at suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG N?rnberg)
next prev parent reply other threads:[~2019-08-06 6:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-03 2:49 [PATCH rfc v2 0/6] nvme controller reset and namespace scan work race conditions Sagi Grimberg
2019-08-03 2:49 ` [PATCH rfc v2 1/6] nvme: fail cancelled commands with NVME_SC_HOST_PATH_ERROR Sagi Grimberg
2019-08-04 7:56 ` Minwoo Im
2019-08-03 2:49 ` [PATCH rfc v2 2/6] nvme: return nvme_error_status for sync commands failure Sagi Grimberg
2019-08-04 7:57 ` Minwoo Im
2019-08-05 18:12 ` Sagi Grimberg
2019-08-03 2:49 ` [PATCH rfc v2 3/6] nvme: make nvme_identify_ns propagate errors back Sagi Grimberg
2019-08-04 8:06 ` Minwoo Im
2019-08-05 12:39 ` Hannes Reinecke
2019-08-05 18:18 ` Sagi Grimberg
2019-08-06 6:33 ` Hannes Reinecke [this message]
2019-08-03 2:49 ` [PATCH rfc v2 4/6] nvme: make nvme_report_ns_ids propagate error back Sagi Grimberg
2019-08-03 2:49 ` [PATCH rfc v2 5/6] nvme-tcp: fail command with NVME_SC_HOST_PATH_ERROR send failed Sagi Grimberg
2019-08-03 2:49 ` [PATCH rfc v2 6/6] nvme: don't remove namespace if revalidate failed because of a transport error Sagi Grimberg
[not found] ` <e04be8bf-20cb-db7d-6046-74d8ec6fa485@broadcom.com>
2019-08-05 19:32 ` Fwd: [PATCH rfc v2 0/6] nvme controller reset and namespace scan work race conditions James Smart
2019-08-05 19:48 ` Sagi Grimberg
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=0d57a9e7-b375-e669-a32d-76a517c36319@suse.de \
--to=hare@suse.de \
/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