Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp446623ybl; Tue, 27 Aug 2019 23:49:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqEfvxnl3VOlvWEAgxydqNla/cjJ6tEwteQ/f5lGo7KcHbLlfIxh2nMogGx95kECbVAbHf X-Received: by 2002:a17:902:96a:: with SMTP id 97mr2784315plm.264.1566974945887; Tue, 27 Aug 2019 23:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566974945; cv=none; d=google.com; s=arc-20160816; b=wFiymNr2pwTPZ+0bCJTSWUpUveB3XyC+HBYg+xHE0V+7IJ4bIKLNTq4DIGYFz6NeyN JBbp0KZw3GM3/Y15mh5ov5wxrkDc89JWdNT4uF+Ye9Vn3Ff3/z9z3gZrfZ5dBGFWEUEC 41Z5Yjn3v0UOxiXj/bo190b3l+7hY7IPQO2iD8/QrFg1y+9UU4/5R4Wp6tCxbc+3PWzt g/m2VZNH2PXvCWq/Ez34hxk8Nx+nAFIZ9xaWTRfJG6Dx9CRoYJ03n5lFjy3m8apw3Jpd 5KqhxmZUkBRGVZrzbayLeKZeqi2WDWbP0bg0NsS7zNbT0ShIcDJ54Lpl1E0PJfp0ZqhB IBoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=bnr47kjwSYX7sFbyrZuRL9/chJw1MwjbhZytcoBlB5o=; b=HyzPIHJ8kYOGGZBNKzOxFp3QcmAzEcet5q9RYVjWdq+mvOlO/PDJQB1VeMvd3BEdEF SkJH5IKl/euO2LeVThTQSw8DMqzs0OYg61KZZAPWN9xKwoCxn7t8IMrql6UWs06JGVn8 5bj8Iw23ytAfxTDjtZmAJSjfeE259I/YCl+IsBYUui6KmrcFFujfeJSypBCkoKaeCpR0 69hpeHxaKVEEBK5obhm6uAudWN1x26RkF5UYpPmdpB7285OW9maiL8WvVBVGrK3bcDBU 7j/0imxXuTIRJtB4rROjmGgutmltkPTiWA6FQZ1jWyc/3sqsajrX8byaimDBN+A7vZi2 1mhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Cx9/eKyZ"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si1164766pje.93.2019.08.27.23.48.49; Tue, 27 Aug 2019 23:49:05 -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=pass header.i=@gmail.com header.s=20161025 header.b="Cx9/eKyZ"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbfH1Gry (ORCPT + 99 others); Wed, 28 Aug 2019 02:47:54 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40450 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbfH1Gry (ORCPT ); Wed, 28 Aug 2019 02:47:54 -0400 Received: by mail-pl1-f193.google.com with SMTP id h3so753917pls.7; Tue, 27 Aug 2019 23:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=bnr47kjwSYX7sFbyrZuRL9/chJw1MwjbhZytcoBlB5o=; b=Cx9/eKyZMzzteG75d/97TvQdpvxY/AUlPeUQmItGvpwgkinp3omAK5ctohoduuAUgf jXKKrh/NL2VTWn42aHIOX6MsZ8DNj048vQ+7qjLPrsx+kBlL4RNf6grEVohifDFAgIEb H/upWcS4Rj6nVpuiPt1L4g3XYsusYygNas5of2T60fZbfdpKTKPmsDi0rVnBXggDpC4d v5uMNv+AeoBc9jsq6RnC65wHU4ZUd5twIthsPjpbe7HLn+cyBi89+4aqgUeJaRJbGeKD WpZ3s72o1ch9NrNYxIxj9qktepdSk49MRQnGGjXUb+ubbj36Db1a+q8Vmd2fXOyNo7P1 RdVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=bnr47kjwSYX7sFbyrZuRL9/chJw1MwjbhZytcoBlB5o=; b=gEVpr2V70d+hnjHpDPma2o4MI8zcCJtj5q3ZW6RWS2CuIF4YEzhAr3k+NHiUjnVFg+ bO+n9tu82XJGgKQ8PqkAKrBQ2kQiOLxl92j9aZKfnvKzHCQGXtUwHWH4AOi5YNk2iKFP TKv8VVzE9IMC9J07BXuMCslAcAbkAioT7P0KdS7HDV2QBU/r1PW+6QjjF/ewuOEvGYlF LKexqDblfBv3tlGbi5bxGK79BoZcQ8Rg+Yac+BojkD7pyIRNz8pjwNhshVwgq+i8+fof NhliIq3vA/czFQ8pI2vid6q1TiacqtwOgw9b6KI6trUQiZWxbQoK4UQDaK496zi8/z9Y v57g== X-Gm-Message-State: APjAAAUrF6rnC6UcwUVFFrTfETVz9hDnvTxns6ulhuyO06UkN7d3KZzb O/1q0qRZeC1xOAZl0bcHopA= X-Received: by 2002:a17:902:7085:: with SMTP id z5mr2814826plk.102.1566974873772; Tue, 27 Aug 2019 23:47:53 -0700 (PDT) Received: from LGEARND20B15 ([27.122.242.75]) by smtp.gmail.com with ESMTPSA id 21sm1437347pfb.96.2019.08.27.23.47.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Aug 2019 23:47:53 -0700 (PDT) Date: Wed, 28 Aug 2019 15:47:49 +0900 From: Austin Kim To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, austindh.kim@gmail.com Subject: [PATCH] xfs: Use WARN_ON rather than BUG() for bailout mount-operation Message-ID: <20190828064749.GA165571@LGEARND20B15> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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))){ spin_unlock(&mp->m_perag_lock); radix_tree_preload_end(); error = -EEXIST; -- 2.6.2