Messages in this thread | | | From | Linus Torvalds <> | Date | Mon, 23 Jul 2012 12:09:21 -0700 | Subject | Re: 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
| |