Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp510294ybl; Thu, 22 Aug 2019 00:07:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1b81bjCmwysoFU/WFDC3cZrvA91De5r//iA3RYo35mTR3uukB6VIp1Algd5m/ZZz53Qd9 X-Received: by 2002:a62:8246:: with SMTP id w67mr40829903pfd.226.1566457665190; Thu, 22 Aug 2019 00:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566457665; cv=none; d=google.com; s=arc-20160816; b=WxWl5x4Ojrkl6M3s149gXcCx85Yb+oL+K4QaqWVKZ6yCii3Ui8w39rFa5uyprhEzGm Wqe2FQjV9nICN6RreZ0hf62uoEVeAkZNq6hOlG6voYxRJ05TBH4EvZ6FR6H2hc42RAVe D8miMW6x/lrdJU0J2y2gmZm6AAVgK4sVneQEdcXsdfsA9nkmWPGmhcwXjfBdN4nAsFlm oXDf3x2scYmg7zu23e1o6EfVG8OWrdVrA2UhYTCfP9DaD8MPOnUZBLeJR3nKLbk4x8Bo i87N32wwsloeNqxrJ0cqq9pDp7flOJ0qis4onB2rKM71NuWVKuCk5SlSzNJZEbszr4Dn NCTQ== 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=CjmFFn8T4mzBuFjitRp7RHPNL4LmUIeCq1YFn9vP/g8=; b=s/KjuBNrY6+cK2eK6LGlOaIgyRiocuQ4X4qx/sL+Q0Gu9AwNBpkNNdRpWvdxKtK7SC Qc3uXhtZJffZWefyR8FaKZf0QOlX1D+oz7WIQBSz1gMC0TIDpNhCMy8eyPTfH8HwykW4 Z6Fl5WwqkUe+mPFpgLcSrNPp68S8xvK8E/KznAxEX8ctphEtw0Pdlu5UOuYOejpMylrb 2uYKSP5IDpHDfCm+NRVNbAANks2q2mgSjuhl1rUDMWvgL4SvMSIAyF/4+ijfXWYren+W nXPkTIW71LADTpePTOzHy/DJP8C7sQKe1Q95WtPAeA2tsEzhZPhccy9EgBcay3UUVttE cnYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QEGZiwC7; 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 o1si17067598pld.73.2019.08.22.00.07.30; Thu, 22 Aug 2019 00:07:45 -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=QEGZiwC7; 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 S1731662AbfHVGX0 (ORCPT + 99 others); Thu, 22 Aug 2019 02:23:26 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33368 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731098AbfHVGX0 (ORCPT ); Thu, 22 Aug 2019 02:23:26 -0400 Received: by mail-pg1-f196.google.com with SMTP id n190so2933301pgn.0; Wed, 21 Aug 2019 23:23:25 -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=CjmFFn8T4mzBuFjitRp7RHPNL4LmUIeCq1YFn9vP/g8=; b=QEGZiwC7PSpT28dJZ3fuiwQkE1MeAaFFXllRO2uS5DfgLvh3/FvXeIY8ycRsnEi7BP AQNrazwXFFilJiBwLE4Ky/0/sroiOAnMVWPxSIFL0ut+R+jKuqF/SUYUeQ871N2+08Ey qDC9Ecyuabc15K33WD1LI3XDwk86AHsoxlUtP5hAG7oUcaZRP33ZvcqKx9BARjXCt7iU BDI8FIOuSJsfSKP8nqhTlAMTPhGgzqC7so1s+zxuPjXunz9u+1m6d9St+qOXQ7/IUscw rNPpNa6F/jsNs9hpU4sDnYD30cfplht66IfY2JCUy9BfkXctMDpD2zUfy2drbDKk7fnm zaZA== 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=CjmFFn8T4mzBuFjitRp7RHPNL4LmUIeCq1YFn9vP/g8=; b=DCGSeu9dU/GzKu22Mdih/TnRHBIicBoJKoH4mAZCUhlDwd6NIQUmDTVMLnollizZxb lsCV4cUrURU3Vn/5zE/g2Fx2jugP7YRZSLygTsoPubQDExZlRoeukhTVs2bN4frW846F nmaR7J0O7RI7z2hQMtfLmCB0okOdENWV8+xMNqmbgwUesM2b9KsOAht/DW+aNq6Bacqq 3gVURcdJTf4mjy0a971H0ErjOYL8k3FZkn3dvPwW6lQ1YplL8tWYRRCQspUq3EGdprHQ nnzKP7fEnIWM/DGO2G+5xkUYIJugXPhnr0nXAox44AEykWF759OgUwf1ch5ubUvT3EPH VFaw== X-Gm-Message-State: APjAAAXfxpqpbhsf1Czmwnn4eBot0DQ6g9tCmKu38HpShCY8Lu7fOwGR leM3RnRruygooDX+lzE3b8g= X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr3747216pjq.79.1566455005334; Wed, 21 Aug 2019 23:23:25 -0700 (PDT) Received: from LGEARND20B15 ([27.122.242.75]) by smtp.gmail.com with ESMTPSA id y14sm54159373pfq.85.2019.08.21.23.23.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 23:23:24 -0700 (PDT) Date: Thu, 22 Aug 2019 15:23:20 +0900 From: Austin Kim To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, austindh.kim@gmail.com Subject: [PATCH] xfs: Use BUG_ON rather than BUG() to remove unreachable code Message-ID: <20190822062320.GA35267@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 Code after BUG is unreachable since system would be crashed after the call to BUG is made. So change BUG_ON instead of BUG() to remove unreachable code. --- fs/xfs/xfs_mount.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 322da69..a681808 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -213,13 +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(); - spin_unlock(&mp->m_perag_lock); - radix_tree_preload_end(); - error = -EEXIST; - goto out_hash_destroy; - } + BUG_ON(radix_tree_insert(&mp->m_perag_tree, index, pag)); spin_unlock(&mp->m_perag_lock); radix_tree_preload_end(); /* first new pag is fully initialized */ -- 2.6.2