[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFxScO3nZPoj8HbHsyuwT1WA6BuT9Hi=A3AD+1LF3JsVCA@mail.gmail.com>
Date: Tue, 2 May 2017 11:37:31 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>
Subject: Re: error value for "internal error"
On Tue, May 2, 2017 at 7:03 AM, Miklos Szeredi <miklos@...redi.hu> wrote:
> I've been wondering what to return for soft asserts like this:
>
> if (WARN_ON(something unexpected))
> return -E????;
>
> EINVAL doesn't fit because it means the input from userspace was
> wrong. EIO means something went bad with the hardware.
I think we've traditionally just used EIO for "something went wrong".
It's not necessarily hardware that went wrong.
That's particularly true when there is a WARN_ON() that then gives
more details of where this actually happened in the system logs - at
that point the error number really doesn't matter all that much.
(Ambiguous error numbers are much more annoying when something goes
wrong, but you can't tell which of 48 different cases it was that
triggered that error number).
Linus
Powered by blists - more mailing lists