public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: ext Artem Bityutskiy <dedekind1@gmail.com>
Cc: linux-mtd@lists.infradead.org, adrian.hunter@nokia.com
Subject: Re: [PATCH 1/1] ubifs: debugfs operations may return both ERRs and NULLs
Date: Mon, 28 Mar 2011 13:38:16 +0300	[thread overview]
Message-ID: <20110328103816.GC2072@esdhcp04044.research.nokia.com> (raw)
In-Reply-To: <1301295087.2816.2.camel@localhost>

On 28/03/11 09:51 +0300, ext Artem Bityutskiy wrote:
> On Wed, 2011-03-23 at 15:35 +0200, Phil Carmody wrote:
> > I knew I invented IS_ERR_OR_NULL for something, and this was probably
> > it. NULL has lost all information about what the error was, and the most
> > appropriate error code is ENODEV. However, that's the only error code
> > that the debugfs functions can return. So basically, any error = ENODEV.
> 
> This is not true that any error is -ENODEV. There are many other errors
> possible, e.g., due to an invocation of simple_pin_fs().

I meant that once you've thrown away all information about the actual
error by turning it into NULL, then the broadest brush that covers the
failure modes is ENODEV. That's why I was asked "what's the most generic
'something's gone wrong' code" on the chat channel the other day.
 
> I think the right fix would be to fix debugfs and return an error code
> in any case.

Agree. Alas it might require hitting a lot of both active and dead code.
Is that something you want me to look at? If you do it yourself, please
Cc: me, I'll happily review it.

Phil

  reply	other threads:[~2011-03-28 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23  9:51 [PATCH 1/1] ubifs: debugfs operations may return both ERRs and NULLs Phil Carmody
2011-03-23 12:41 ` Artem Bityutskiy
2011-03-23 13:16   ` Phil Carmody
2011-03-23 13:35     ` Phil Carmody
2011-03-28  6:51       ` Artem Bityutskiy
2011-03-28 10:38         ` Phil Carmody [this message]
2011-03-28 12:10           ` Artem Bityutskiy
2011-03-23 13:18   ` Artem Bityutskiy

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=20110328103816.GC2072@esdhcp04044.research.nokia.com \
    --to=ext-phil.2.carmody@nokia.com \
    --cc=adrian.hunter@nokia.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@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