From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbdKCJiL (ORCPT ); Fri, 3 Nov 2017 05:38:11 -0400 Received: from ozlabs.org ([103.22.144.67]:34991 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbdKCJiK (ORCPT ); Fri, 3 Nov 2017 05:38:10 -0400 From: Michael Ellerman To: Andi Kleen , akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH] Support resetting WARN_ONCE for all architectures In-Reply-To: <20171019204642.7404-1-andi@firstfloor.org> References: <20171019204642.7404-1-andi@firstfloor.org> Date: Fri, 03 Nov 2017 20:38:03 +1100 Message-ID: <878tfn7ldw.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andi, Thanks for making it work with the flag, but ... Andi Kleen writes: > diff --git a/lib/bug.c b/lib/bug.c > index a6a1137d06db..7cb2d41845f7 100644 > --- a/lib/bug.c > +++ b/lib/bug.c > @@ -195,3 +195,24 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) > > return BUG_TRAP_TYPE_BUG; > } > + > +static void clear_once_table(struct bug_entry *start, struct bug_entry *end) > +{ > + struct bug_entry *bug; > + > + for (bug = start; bug < end; bug++) > + bug->flags &= ~BUGFLAG_ONCE; Clearing BUGFLAG_ONCE removes the once-ness permanently. ie. it becomes a WARN(). You should be clearing BUGFLAG_DONE, which is the flag that says this WARN has already triggered. cheers