From: Miklos Szeredi <miklos@szeredi.hu> To: linux-kernel@vger.kernel.org, Linux API <linux-api@vger.kernel.org>, Linus Torvalds <torvalds@linux-foundation.org> Subject: error value for "internal error" Date: Tue, 2 May 2017 16:03:34 +0200 [thread overview] Message-ID: <CAJfpegv3xS_MEVVeAnd4JUvjxoJd9PQdbsEzCPXNpUeex4SxHA@mail.gmail.com> (raw) 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. There's no "software error" or "internal error" type return code. Would it make sense to introduce one? Rule would be to always add more detail to dmesg (such as done by WARN_ON) when such a code is returned. Thanks, Miklos
WARNING: multiple messages have this Message-ID (diff)
From: Miklos Szeredi <miklos-sUDqSbJrdHQHWmgEVkV9KA@public.gmane.org> To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> Subject: error value for "internal error" Date: Tue, 2 May 2017 16:03:34 +0200 [thread overview] Message-ID: <CAJfpegv3xS_MEVVeAnd4JUvjxoJd9PQdbsEzCPXNpUeex4SxHA@mail.gmail.com> (raw) 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. There's no "software error" or "internal error" type return code. Would it make sense to introduce one? Rule would be to always add more detail to dmesg (such as done by WARN_ON) when such a code is returned. Thanks, Miklos
next reply other threads:[~2017-05-02 14:03 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-05-02 14:03 Miklos Szeredi [this message] 2017-05-02 14:03 ` error value for "internal error" Miklos Szeredi 2017-05-02 18:37 ` Linus Torvalds 2017-05-02 18:37 ` Linus Torvalds 2017-05-03 9:10 ` Miklos Szeredi 2017-05-03 9:10 ` Miklos Szeredi
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=CAJfpegv3xS_MEVVeAnd4JUvjxoJd9PQdbsEzCPXNpUeex4SxHA@mail.gmail.com \ --to=miklos@szeredi.hu \ --cc=linux-api@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=torvalds@linux-foundation.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.