Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp64611ybl; Thu, 29 Aug 2019 18:42:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9DQdRfGyoEm7+cyfbKeITL7EiZbckWw0GU2Klzim4GD61WKfXd7sHW3S+vDWlg/orP+jb X-Received: by 2002:a17:902:b20c:: with SMTP id t12mr13093345plr.205.1567129367643; Thu, 29 Aug 2019 18:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567129367; cv=none; d=google.com; s=arc-20160816; b=cByL1XPCaSlxeZ0OU5fTzNVbYa3P5ssvKdmfgAdHgUuzhY91swt3Nuka1HaYMgqb2A UOZIrUugvWwZIHR+zNjq/iI4lZ4gdv5t0U/08HB1k/VtwDnRvmf7TRKClcNm7sjDorCT HuurQDenOHEKk5qvp7dhrA1HLPaNqxM37nPQ/0tp+eYfHUdfaM/60C7+/Ow6Ep/CeaHZ IamSlRyIhPL/QogLEJwElrgn7bi4LwylmnKHbTOc3P9SvjnITsjiYzwW0dRUNBC/J6DK 6dmg1jx1+ozjSS/9FsPWi3Ftm0pEMdi/AR+K4ulz9MaiCY4unFGRrhfYIbNmSq1YlKr/ Q+Gw== 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=/Lp6+wPpOLr+QBiQVP34X35aQP4sAer1yeUvbRho3WA=; b=yvg3yqEpk4Y7cWspGfbNADp7OojvuG/DsCp58wyW3VUuXfAsEbTQYpXcpKRvRSfSJV 4GrNCYNaF9M1Po3niXz24qyK+tfoaEvOw5BAiqd3lhIZCTwSlksILYbTp9g4/Tx6OjlZ X9uxViMDwxbCDkyvwA1C/D/Tp+tJCgUyIDG464mjrk8lrpjck+RxrFUdI/IficgFD5Lx Kfd0H8PZ35wJtzVIqTgNz/gXcUuTZHOR0h6/JqFhAbUGU1DHrQmj8MhA15TUREedvFui IgjfMgq/GEU79gJu9FyruSg4B1rm9zvrECtIwluK4xV3mOsxU1Aega2/6bZ5y3QRwV9w tjuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T5UsmuqO; 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 r139si4501940pfc.276.2019.08.29.18.42.32; Thu, 29 Aug 2019 18:42:47 -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=T5UsmuqO; 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 S1727413AbfH3BlP (ORCPT + 99 others); Thu, 29 Aug 2019 21:41:15 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46371 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727139AbfH3BlP (ORCPT ); Thu, 29 Aug 2019 21:41:15 -0400 Received: by mail-pg1-f193.google.com with SMTP id m3so2598661pgv.13; Thu, 29 Aug 2019 18:41:15 -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=/Lp6+wPpOLr+QBiQVP34X35aQP4sAer1yeUvbRho3WA=; b=T5UsmuqOFpHuAdyZzaXOpR+04JgvYjmBsGflC74rtgqqOGyLZDvtmkTMXnemun2joX YgtGwUgDEMXuCyLXBnEDOZEYWWd8xFxz/YnxKyZpp0Ss7dzuKzBEUo53xRd4+Dr+uDvs ck58yTFepfXbmsOhFwHO6XBVVUk8YXA6sW5g8t6tuwNArBkoQm0NWIjevhFhcFXf9hET Xd2jfjAN5V8jox3+CyQmRHyp0btS4wxXUME9w+KuL7aIL/aNq5Nj/p+wS10u/XJtDWtn kKKQ8NGK+N7/G31PJKepPShzFGT51zro8UbF0Y/ooETsSPPmOW5Tuhdl3Gq1mEWYstlI AUwA== 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=/Lp6+wPpOLr+QBiQVP34X35aQP4sAer1yeUvbRho3WA=; b=HJB+rP+cCWwRotKx2C0P6eldupe/fhYc9M2KpObF4UABgSFjl90K6pt01IYdMWvx8R MLdAOS33gIuigGp4yI5NmwD7HknG2gDQsISFAXCWQfzCTHcm4W5Ht5ppIXaakP0tVkM7 ArNZuFoxmemh+SawM8BqAKno//z6X4FYDyK2T079bOF5raW4E1xKH7TvAbHq51JFGC70 JlqqOOCCRMQBbeWyncr8bGocnLOYesBUTfPzg7sm3FANw3Vua9G7GyeYmQQqcHlNCRDj s8WIRdvWtW/CHC/pDxjPEqliGTc7nI8cTmhNjlArq4LLo2xJzZHPyJ3FyRiFb8F8fqqu 35Rw== X-Gm-Message-State: APjAAAUaZDP7PZaZYRh6SZvDv3Rq4a4lDAITO4ChHgINwPtojddD20fn dgtmXeg/tfZ5HFzgRJsWl20= X-Received: by 2002:a63:290:: with SMTP id 138mr9984863pgc.402.1567129274662; Thu, 29 Aug 2019 18:41:14 -0700 (PDT) Received: from LGEARND20B15 ([27.122.242.75]) by smtp.gmail.com with ESMTPSA id t23sm4549984pfl.154.2019.08.29.18.41.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 18:41:14 -0700 (PDT) Date: Fri, 30 Aug 2019 10:41:10 +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 for bailout mount-operation Message-ID: <20190830014110.GA20651@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. Using WARN_ON_ONCE rather than BUG can prevent this situation. Signed-off-by: Austin Kim --- fs/xfs/xfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 322da69..3ab2acf 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -214,7 +214,7 @@ xfs_initialize_perag( spin_lock(&mp->m_perag_lock); if (radix_tree_insert(&mp->m_perag_tree, index, pag)) { - BUG(); + WARN_ON_ONCE(1); spin_unlock(&mp->m_perag_lock); radix_tree_preload_end(); error = -EEXIST; -- 2.6.2