Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbdHGTzk (ORCPT ); Mon, 7 Aug 2017 15:55:40 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:42566 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751748AbdHGTzi (ORCPT ); Mon, 7 Aug 2017 15:55:38 -0400 Date: Mon, 7 Aug 2017 21:55:13 +0200 From: Ralf Baechle 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 Subject: Re: [PATCH 4/7] signal/mips: Document a conflict with SI_USER with SIGFPE 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 774 Lines: 21 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