lkml.org 
[lkml]   [2012]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Remove easily user-triggerable BUG from generic_setlease
On Mon, Jul 23, 2012 at 12:04 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
>
> Right, I wasn't clear: that patch should go to mainline as well.

Does it do anything in mainline?

> (Then, do we still want Dave's patch?: in some sense that BUG() was
> correct

Hell no.

A BUG() is *never* correct unless it's a situation where not having
the bug would do something worse (ie subtly corrupt memory). And quite
frankly, if you had a BUG() there and knew about the memory
corruption, that's just a f*cking disgrace. So no, no excuse for
BUG()s like that.

NEVER EVER add BUG() as a "well, that was unexpected". That way lies
exactly the kinds of denial-of-service attacks that that BUG() caused.

The only valid source of BUG() is if you actually find internal data
structure *corruption*, and you say "ok, I cannot possibly continue,
because anything I would do would be wrong".

Seriously. People who use BUG() statements like some kind of assert()
are a menace to society. They kill machines.

Linus


\
 
 \ /
  Last update: 2012-07-23 21:41    [W:0.047 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site