From patchwork Fri Nov 3 18:50:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 10041049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 121CB602D8 for ; Fri, 3 Nov 2017 18:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0567229775 for ; Fri, 3 Nov 2017 18:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE7AD29857; Fri, 3 Nov 2017 18:50:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE3B29775 for ; Fri, 3 Nov 2017 18:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbdKCSup (ORCPT ); Fri, 3 Nov 2017 14:50:45 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:39486 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbdKCSup (ORCPT ); Fri, 3 Nov 2017 14:50:45 -0400 Received: from [172.16.24.21] (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id vA3IodJQ023886; Fri, 3 Nov 2017 21:50:40 +0300 (MSK) From: Vasily Averin Subject: [PATCH v2] grace: replace BUG_ON by WARN in exit_net hook To: linux-nfs@vger.kernel.org, "J. Bruce Fields" , Jeff Layton Message-ID: <903128e5-12e8-090f-ed8c-fd76777f8047@virtuozzo.com> Date: Fri, 3 Nov 2017 21:50:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP let's generate warning instead of kernel crash [ 9313.047796] NFSD: starting 90-second grace period (net ffff880e307fe240) [ 9317.257203] nfsd: last server has exited, flushing export cache ... [ 9320.097513] net ffff880e307fe240 exit: grace_list is not empty [ 9320.098570] WARNING: CPU: 5 PID: 1556 at fs/nfs_common/grace.c:112 grace_exit_net+0x33/0x40 [grace] v2: net pointer added to warning message Signed-off-by: Vasily Averin --- fs/nfs_common/grace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c index 420d3a0..3c602df 100644 --- a/fs/nfs_common/grace.c +++ b/fs/nfs_common/grace.c @@ -104,7 +104,8 @@ grace_exit_net(struct net *net) { struct list_head *grace_list = net_generic(net, grace_net_id); - BUG_ON(!list_empty(grace_list)); + WARN(!list_empty(grace_list), + "net %p exit: grace_list is not empty\n", net); } static struct pernet_operations grace_net_ops = {