From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: Re: [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook Date: Tue, 7 Nov 2017 15:26:17 +0300 Message-ID: <20171107122617.GB2260@avx2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net To: vvs@virtuozzo.com Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:55171 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933726AbdKGM0U (ORCPT ); Tue, 7 Nov 2017 07:26:20 -0500 Received: by mail-wr0-f194.google.com with SMTP id l22so915091wrc.11 for ; Tue, 07 Nov 2017 04:26:20 -0800 (PST) Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-ID: > - BUG_ON(!list_empty(grace_list)); > + WARN_ONCE(!list_empty(grace_list), > + "net %x %s: grace_list is not empty\n", > + net->ns.inum, __func__); * printing __func__ is unnecessary as it will be on top of the stacktrace anyway, * message duplicates condition * printing netns id in netns ->exit hook also looks like pointless information: for kernel dumps you want struct net pointer right away. You wrote admins want to know which container triggered the message but what will they do with that information? I'd say WARN_ONCE(!list_empty()) is enough. BUG_ON if you ship with crashdumps by default.