From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Arnd Bergmann" <arnd@arndb.de>, "Michal Marek" <mmarek@suse.com>,
"Макс Жуков" <mussitantesmortem@gmail.com>,
nicolas.ferre@atmel.com,
"Nicolas Pitre" <nicolas.pitre@linaro.org>,
robert.jarzmik@free.fr, yamada.masahiro@socionext.com,
"Linux Kbuild mailing list" <linux-kbuild@vger.kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Bob Peterson" <rpeterso@redhat.com>
Subject: Re: [GIT PULL] kbuild updates for v4.7-rc1
Date: Fri, 27 May 2016 22:52:10 +0100 [thread overview]
Message-ID: <20160527215210.GU14480@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFzQ4oe6cT5xf=3xT1d6ji2L_her8AmJxpsixFw_GavDvg@mail.gmail.com>
On Fri, May 27, 2016 at 01:20:29PM -0700, Linus Torvalds wrote:
> I didn't look at the details of your patch, but I did look at several
> IS_ERR_VALUE() uses in the standard kernel, and they were basically
> all wrong. Even the ones that used it for the rigth reason (vm_brk()
> that returns a pointer or an error in an "unsigned long") had actively
> screwed up and truncated that (correct) unsigned long value to "int"
> before doing the IS_ERR_VALUE(), which made it all wrong again.
>
> And the other users just looked entirely bogus, and were all just
> "zero or negative error code" that has nothing to do with
> IS_ERR_VALUE(). The code should just check against zero, not use that
> macro that was designed for something different.
Both gfs2 ones and the one in fs/romfs are crap. AFS one is simply ridiculous -
result = generic_file_write_iter(iocb, from);
if (IS_ERR_VALUE(result)) {
_leave(" = %zd", result);
return result;
}
_leave(" = %zd", result);
return result;
In binfmt*.c some callers are valid (vm_mmap and vm_brk values; BTW, the
code in binfmt_flat.c checks for vm_mmap returning 0, which should never
happen, AFAICS). Most of binfmt_flat.c ones are pure cargo-culting.
net/9p/client.c ones are results of serious mistake in design of 9P.L
extensions to 9P - they assume that numeric values of E... are
architecture-independent and send them over the wire. The uses of
IS_ERR_VALUE there are papering over that. Badly.
A couple of sound/* ones should be simply "is negative".
netfilter ones are caused by bad calling conventions of
xt_percpu_counter_alloc().
I hadn't looked through drivers/* users, but judging by fs/, net/ and sound/,
I would expect them to be pointless garbage in the best case and red flags
for broken code in the worst.
IMO IS_ERR_VALUE() should be renamed to something less generic and be used
a lot less than it is right now.
prev parent reply other threads:[~2016-05-27 21:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 20:33 [GIT PULL] kbuild updates for v4.7-rc1 Michal Marek
2016-05-27 5:26 ` Linus Torvalds
2016-05-27 12:33 ` Arnd Bergmann
2016-05-27 17:23 ` Linus Torvalds
2016-05-27 18:28 ` Linus Torvalds
2016-05-27 20:04 ` Arnd Bergmann
2016-05-27 20:20 ` Linus Torvalds
2016-05-27 21:36 ` Arnd Bergmann
2016-05-27 21:52 ` Al Viro [this message]
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=20160527215210.GU14480@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=arnd@arndb.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=mussitantesmortem@gmail.com \
--cc=nicolas.ferre@atmel.com \
--cc=nicolas.pitre@linaro.org \
--cc=robert.jarzmik@free.fr \
--cc=rpeterso@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=yamada.masahiro@socionext.com \
/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;
as well as URLs for NNTP newsgroup(s).