Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbbFYBxB (ORCPT ); Wed, 24 Jun 2015 21:53:01 -0400 Received: from mga03.intel.com ([134.134.136.65]:13274 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796AbbFYBwy (ORCPT ); Wed, 24 Jun 2015 21:52:54 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,674,1427785200"; d="scan'208";a="594299651" From: "Weiny, Ira" To: Linus Torvalds , David Miller , Doug Ledford CC: Andrew Morton , Network Development , Linux Kernel Mailing List , "'Jason Gunthorpe (jgunthorpe@obsidianresearch.com)'" Subject: RE: [GIT] Networking Thread-Topic: [GIT] Networking Thread-Index: AQHQrtb2hphKkYpWeEirK5cIDs3VRp28YmMg Date: Thu, 25 Jun 2015 01:52:49 +0000 Message-ID: <2807E5FD2F6FDA4886F6618EAC48510E110A2D71@CRSMSX101.amr.corp.intel.com> References: <20150624.063911.1220157256743743341.davem@davemloft.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.205.10] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t5P1r6E8020227 Content-Length: 1770 Lines: 45 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?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?