Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2492ybl; Thu, 29 Aug 2019 17:31:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqBffL1YyjfxEQ4RT8O9dHcuJDh5hs1Hx+JQ3CXs/uNAjzCI24FbRK9nDwwg9mzfFKl1Ro X-Received: by 2002:aa7:85cd:: with SMTP id z13mr15166071pfn.214.1567125116807; Thu, 29 Aug 2019 17:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567125116; cv=none; d=google.com; s=arc-20160816; b=SGbt0atQJ8yODgpVHGmksB0znf1hFCq2fOOy5zMe+oQ4kb96hj6Tsfsev/tTy/RJzn zluOmuqvIenMd4Ze+XjlfViROkLvui9FkP0po/kYh7aNfGblyzfG6Xl34NWK+cV70Gt6 J+Ar+Rs8HqiD3XqdCDnd3Q14HJUjpDtAt5PL9ovZv8jvU06yKzxpVZh82snto++xHAZf wMDgGmoyuuo/L7EPBw3SnZqm4dIzqOkT/gRVI0pDcdlLl/CsSc0/v6d0zuDKYgF1jTSS 0czffYXC7AwLLFqXw9Fv7bxVNPaWkFuvaES3Sewr7osOEvGdCnNwng4VJXJplnXqY2He bHHg== 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=laobROPMCD2dDBoUPF6ZOG8vC/RUeuCzEEYz7L8tAVA=; b=ovquUqYU9tlnEXkK4MBs6DPySw1KkRlbC+/OMzZP4o5ZFyR0ve95/tozvHh1tIuL/Y Y7cS/90aO2tEOekHcceWFEHIH3ibgy3bg5WwHc6vL2PRQ72jR4Wu5mP9oNu89vmX/gxi +FBgQ7wr0ouYNXJqnHOd+Q1CTzHp0Gs6rw0j0KTZGB+3TgGsG0wt5d/+EslqjhlU/Q0A Ty+Pt1KDAJ7Y/6mwlfnn/nJKF2IWe/uQwxMYZ0My+6s9m4uOm58QQxyoLc7rQMWdOQ5S gAuFlO5TTNp2+kQvvwbnS4BRnFQqNwGL5XeFqbMnC12uvXO0Jwu1M7Nra+WJM9rgP//V rSgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YUluvd3R; 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 a18si4397092pfa.177.2019.08.29.17.31.40; Thu, 29 Aug 2019 17:31:56 -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=YUluvd3R; 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 S1727400AbfH3Aa1 (ORCPT + 99 others); Thu, 29 Aug 2019 20:30:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34395 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727096AbfH3Aa1 (ORCPT ); Thu, 29 Aug 2019 20:30:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id n9so2534379pgc.1; Thu, 29 Aug 2019 17:30:26 -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=laobROPMCD2dDBoUPF6ZOG8vC/RUeuCzEEYz7L8tAVA=; b=YUluvd3R2pC2zOLTvie3Ri5/rwIIDDMPdRoHLUKZQm3VlFTMsCcPhGQDKLJjew+kO2 C4NNa3Ju3jSyv/W8tsmeXQydQpUImWGEod8YQq3Yz41m4pqVwh9JyUAqnzpRUjXE4/ld eqOLNN3hvwzn2Iwmx+k7enJSYD9fz/iQbF8GFH6Tjwz3bvgQCqaQCTmffFZ9jkuMUVgR FqoCDz2zZD7NRzdJRQBFyAieNR1BaVQKiPs1pwrm6GLqvMOqC3ib+yfKTxi2VX2tmkSu DxSSI2c9XoGDd8Ipia2BYZCt+ThGQBal9docK/DGuhBGYZCJaGB12w9JPgpGYND634f4 dVow== 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=laobROPMCD2dDBoUPF6ZOG8vC/RUeuCzEEYz7L8tAVA=; b=mDwCKfq3VlLANVCokjyCbviwZ9gGj0PT0WJJsS+USNAbASxKio2fKtQtm64wgNxAJy C9NNepy77XGLitffV57iinbMEf33uhMhqzGGq/6dSQ6ZIYUwfI/Cu1SBBGWI29ylSR7n UK2xRuuI+m//zkE3IeehXlsaputNb0IqvF8yQrCiMT2vePPw787jmW5O6yqtt1n7c9CJ BVHg5ZCSLc2uwGps2GiOThmqCuJb8c7EDzur2a7VxMl3THcVghgyYCzi3PAnh4LQzShu UpkjbH+nxnd9ck1qTyGH0Cx03FJoDt5ua0XAM4nKs+2uQO+FRz6eEBoxTBY6vsjuGce5 0MNg== X-Gm-Message-State: APjAAAVGE/8mbqvw4eczCp4Fdhrv2Y5GUkKTCQwhKrfHJsu54o5ZdSw7 RBs37pesdHPD/H3EdO8N0L9/XYRl X-Received: by 2002:a62:8688:: with SMTP id x130mr15526081pfd.162.1567125026337; Thu, 29 Aug 2019 17:30:26 -0700 (PDT) Received: from LGEARND20B15 ([27.122.242.75]) by smtp.gmail.com with ESMTPSA id a4sm4143607pfi.55.2019.08.29.17.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 17:30:25 -0700 (PDT) Date: Fri, 30 Aug 2019 09:30:22 +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_ONCE rather than BUG for bailout mount-operation Message-ID: <20190830003022.GA152970@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_ONCE rather than BUG can prevent this situation. Signed-off-by: Austin Kim --- 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..c0d0b72 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_ONCE(radix_tree_insert(&mp->m_perag_tree, index, pag))) { spin_unlock(&mp->m_perag_lock); radix_tree_preload_end(); error = -EEXIST; -- 2.6.2