Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1962551ybl; Thu, 29 Aug 2019 01:19:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqykY247klidENEx94WHciOGnyD9ZQkSVbmPiVlUIkIqNFxKppnzp/+c0UU91hr1je1DcWB0 X-Received: by 2002:a17:902:12d:: with SMTP id 42mr8160551plb.187.1567066779194; Thu, 29 Aug 2019 01:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567066779; cv=none; d=google.com; s=arc-20160816; b=WC2/i0X2sbQVpjNZa5Rq/yjYcLgz17FKe/v5Gw+atBZcdpnusApaljvz3JZDcBPr26 Lem3bHXlCr2neyUKIpo2L8FhYPvV0KrTLWUQ3jOk7AcBv1okarSWGi8To37ETovZiSns eVA+r+XnwUFAbU96t1IN6+yOne4z+PAc8JvPg/YRybGFzo7JU3BtGzuXyXhdf1S9lB9C iQ+bNF2X4dLPX1PQ0YpnOyQXXAD+ukCmgwq5X4aTuybjZrkRCjCFMc0VJmY1xpnazHtP 7CqSLA6ou5Djd31J1egL7DKxsvJAPA2lNjSZgqCU3UGWmPNoc8s9aUuJ3ZCiXMxobAlq 3uMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+nN7LOG/9+PKf4MO2yNXSDt1shVfEIbqMZtjoPPRqmk=; b=cNd4lpS4dUJm7x2+SPgM10kBjhgxEeTSrovW2DvDtEVbZOHh0eFMydDG1c+4b95+x8 5bpHPfhKirFg4muR/SxEr+//L+2wdCV/7jcbkv7+rhdvSCZKQNwLqt/LrZ/c1oki03FB ON/W9nozCjFJxF/s7wQ4Dg/Yn85GZhD7VbhyiO2COikozOsBv6XCLENX05z0CAKNR6xk PPOgAMC9dxfVP/lon/R/eoTi3nQPfN4dC1I3CrkjJXaWWEyVmIomIepyWkYbHPkoHWMB FPC/hrbt/gq8IqIx9tPkwGd+WUYzRj4maiE8rEjas97tyEpTrJL4HQo5+4L5c+i6jOiN IVxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BuQpb4bI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si1148161pgg.565.2019.08.29.01.19.22; Thu, 29 Aug 2019 01:19:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BuQpb4bI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727020AbfH2ISZ (ORCPT + 99 others); Thu, 29 Aug 2019 04:18:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57998 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfH2ISY (ORCPT ); Thu, 29 Aug 2019 04:18:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+nN7LOG/9+PKf4MO2yNXSDt1shVfEIbqMZtjoPPRqmk=; b=BuQpb4bI2JGUOh8Mn3/Sw74zB RPpCQpwnQA8gJQRLqYO7yK1qZcgp/nG0UTmo3zkcc62gOoKwMvFKJsgcxpR1xwlEji7BFq0yxinAE ABzTl2OgPgOyL5PrlA38UwwJ9E5Ts27dPHEfOSSelBEfMMYYNcqwsCn/aDEKMPKw55Y1D2p4ADzLV tiBf2ZlKvZd2YjjOEp2MMSq4YH4E7F8ZHK+hA77KrzjNkkL4NBOpcnqxlgpcNCuIhv3qgRpxYAxfF 4LyqdFgbRtjyi3rNJDWKt7LWjek+HhaDe/j+L40gQcQ9h6kR8Q2ScU2S8tNERxyR0gnZB26Q0ZFfL r6yYYtT7w==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i3FId-0004Td-4D; Thu, 29 Aug 2019 07:56:55 +0000 Date: Thu, 29 Aug 2019 00:56:55 -0700 From: Christoph Hellwig To: Austin Kim Cc: darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: Use WARN_ON rather than BUG() for bailout mount-operation Message-ID: <20190829075655.GD18966@infradead.org> References: <20190828064749.GA165571@LGEARND20B15> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190828064749.GA165571@LGEARND20B15> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 28, 2019 at 03:47:49PM +0900, Austin Kim wrote: > If the CONFIG_BUG is enabled, BUG() is executed and then system is crashed. > However, the bailout for mount is no longer proceeding. > > For this reason, using WARN_ON rather than BUG() could prevent this situation. > --- > fs/xfs/xfs_mount.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > index 322da69..10fe000 100644 > --- a/fs/xfs/xfs_mount.c > +++ b/fs/xfs/xfs_mount.c > @@ -213,8 +213,7 @@ xfs_initialize_perag( > goto out_hash_destroy; > > spin_lock(&mp->m_perag_lock); > - if (radix_tree_insert(&mp->m_perag_tree, index, pag)) { > - BUG(); > + if (WARN_ON(radix_tree_insert(&mp->m_perag_tree, index, pag))){ Please make this a WARN_ON_ONCE so that we don't see a flodding of messages in case of this error.