RE: [GIT] Networking

Weiny, Ira
2015-06-25T01:53:01Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1770 bytes --]

Linus,

>
> On the *other* side of the same conflict, I find an even more offensive commit,
> namely commit 4cd7c9479aff ("IB/mad: Add support for additional MAD info
> to/from drivers") which adds a BUG_ON() for a sanity check, rather than just
> returning -EINVAL or something sane like that.
>
> I'm getting *real* tired of that BUG_ON() shit. I realize that infiniband is a
> niche market, and those "commercial grade" niche markets are more-than-
> used-to crap code and horrible hacks, but this is still the kernel. We don't add
> random machine-killing debug checks when it is *so* simple to just do
>
> if (WARN_ON_ONCE(..))
> return -EINVAL;
>
> instead.

Please accept my apologies. The original patch used WARN_ON but I was advised to use BUG_ON in a review and I should have thought about it more rather than blindly make the change.

>
> Killing the machine for idiotic things like that is truly offensive, and truly
> horrible horrible code. Why do I keep on having to tell people off for doing
> these things? Why do people keep thinking that debugging-by-killing-the-
> machine is a good idea?
>
> Either that BUG_ON() cannot possibly happen, in which case it should damn
> well not exist in the first place. Or it's a valuable debug aid, in which case it
> should damn well not be a BUG_ON. You can't have it both ways.

It was intended as a debug aid.

>
> The next pointless BUG_ON() I see, I will start getting _really_ unpleasant
> about.
>
> Doug, get rid of those things asap.

Fix submitted to Doug.

https://patchwork.kernel.org/patch/6671931/

Ira

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥