[PATCH 1/1] ubifs: debugfs operations may return both ERRs and NULLs

Phil Carmody ext-phil.2.carmody at nokia.com
Mon Mar 28 06:38:16 EDT 2011


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



More information about the linux-mtd mailing list