Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbdHGRlo (ORCPT ); Mon, 7 Aug 2017 13:41:44 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:35935 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbdHGRlk (ORCPT ); Mon, 7 Aug 2017 13:41:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-4-ebiederm@xmission.com> From: Linus Torvalds Date: Mon, 7 Aug 2017 10:41:39 -0700 X-Google-Sender-Auth: 3hn2PgWcv2cY9nDGp3mqjR0UXHQ Message-ID: Subject: Re: [PATCH 4/7] signal/mips: Document a conflict with SI_USER with SIGFPE To: "Maciej W. Rozycki" Cc: "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 , Ralf Baechle Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 655 Lines: 17 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. Linus