From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralf Baechle Subject: Re: [PATCH 4/7] signal/mips: Document a conflict with SI_USER with SIGFPE Date: Mon, 7 Aug 2017 21:55:13 +0200 Message-ID: <20170807195513.GD3509@linux-mips.org> References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-4-ebiederm@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from localhost.localdomain ([127.0.0.1]:60724 "EHLO linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by eddie.linux-mips.org with ESMTP id S23995122AbdHGTzfRosT2 (ORCPT + 2 others); Mon, 7 Aug 2017 21:55:35 +0200 Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org To: Linus Torvalds Cc: "Maciej W. Rozycki" , "Eric W. Biederman" , Linux Kernel Mailing List , Andy Lutomirski , Al Viro , Oleg Nesterov , Andrei Vagin , Thomas Gleixner , Greg KH , Andrey Vagin , Serge Hallyn , Pavel Emelyanov , Cyrill Gorcunov , Peter Zijlstra , Willy Tarreau , "linux-arch@vger.kernel.org" , Linux API , Linux Containers , Michael Kerrisk List-Id: linux-api@vger.kernel.org On Mon, Aug 07, 2017 at 10:41:39AM -0700, Linus Torvalds wrote: > On Mon, Aug 7, 2017 at 9:18 AM, Maciej W. Rozycki wrote: > > > > So what would be the right value of `si_code' to use here for such an > > unexpected exception condition? I think `BUG()' would be too big a > > hammer here. Or wouldn't it? > > Hell no. NEVER EVER BUG(). > > The only case to use BUG() is if there is some core data structure > (say, kernel stack) that is so corrupted that you know you cannot > continue. That's the *only* valid use. > > If this is a "this condition cannot happen" issue, then just remove > the damn conditional. It's pointless. Adding a BUG() to show "this > cannot happen" is not acceptable. I queued a patch to remove the code for 4.14. Ralf