[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFx8EgB8ZV5R+uXLX9+t=C5b=Caon8pYqw09-tNEu9SBTg@mail.gmail.com>
Date: Sun, 21 Jun 2015 14:16:15 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Andrey Ryabinin <a.ryabinin@...sung.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [git pull] vfs part 2
On Sun, Jun 21, 2015 at 2:12 PM, Al Viro <viro@...iv.linux.org.uk> wrote:
> + if (count > rsize) {
> + WARN_ON(1);
> + count = rsize;
> + }
So if we'd actually want to merge it with the warning, I'd prefer writing it as
if (WARN_ON_ONCE(count > rsize))
count = size;
because it's smaller and cannot spam your logs. WARN_ON_ONCE() will
only _warn_ once, but it always returns the conditional for the
warning, so the above does the right thing.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists