Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2104401lkv; Thu, 20 May 2021 03:30:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmxGYqnwVvETxowT1Ue/rcc9twewlla3OlIIoaGjLcCXf+NwF/SWHlmE0QUQKRAeRHk2ht X-Received: by 2002:a05:6e02:1baf:: with SMTP id n15mr4486863ili.148.1621506644959; Thu, 20 May 2021 03:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621506644; cv=none; d=google.com; s=arc-20160816; b=euijHZPUgDgsUtkAGeeAk2IESMaG9ypmKOSksiVz30v0QdKj93K/tePNAhl+AnbGbK 2Sf36B0KPj4AsoReR+sOeEWLvmpDeGi84z2yKDgUgqWLML1QyHpIwqxRsQdlHChG5G41 zrn2eytzkK5QFsgWODVR50WLm6NxKfgbzl4AlohWDtb7InWPnyR00ZNRqmWllIcD+KFY loML5JBgjB9wN4wN7oIFfZ0i1vu6a6d6VINA7s84sVC0JF4ujUjxWAmfK8jtdA9Y/I1S 2KyxKMb27UAUajh8y+NSRtq0dkKY+I8v0lWwxeEgFxF8uINTncuJ3tw4DhiL21ovc4k3 8zDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7oJtybbEP0UaHbqG9VEII/F08snKKY5Y4utipCEimEk=; b=wTn+FYIUj/zbzJno9vy0VHohUVdXKMI47980wG14so7J0kN0QudyHvdMR/66wYVXzp bFGpdx3fmnJbM7VHJJavidoLg5mRcI2po4kA1qqAlvi8gYJtlFDsRi+EYWorq5J6JGRP 1dQTilzemjhfbf3jwq02NKS81WvRW6qM9utgNq7k1VzW52ogyJHKxS69N8m9J9SYSUiX LkQsmURzu/cmluJtweMOS7rJI6iDUgltsp2nU4tOcv3vdl9vrqeK0sZkDD+tTXkJpDfV bhZyNed4rUGp6kNUAzcumWjnyNJ23yu3dSNmMHs3gcMl94GmntI5Ly/Aa7gUYGU34xUW LYvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iRVfZMgB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si1792871ioh.78.2021.05.20.03.30.30; Thu, 20 May 2021 03:30:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iRVfZMgB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236950AbhETKaq (ORCPT + 99 others); Thu, 20 May 2021 06:30:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:48156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235897AbhETKRa (ORCPT ); Thu, 20 May 2021 06:17:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87100619AA; Thu, 20 May 2021 09:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503990; bh=tlO2siHJUQfvhnKHtCRO7YA5YCYNwzREQxpqx/9Zkow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iRVfZMgBI4JibeYSO+PJ8gTPibUl10PtGW5xcZ4Vg5zF9pR90sD6TRtZAftn1xkvl 2Fzkz/VIDzn2g3Vr7XDAuaCWKHI+3rIFytAnhcglS/Wtwz1ucneFrm//iLAiy4zocz qg6fxfiNG5HOrvLo5GUxpse6YBYCMA972ZXlN1j0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , Josef Bacik , David Sterba , Sasha Levin Subject: [PATCH 4.14 044/323] btrfs: convert logic BUG_ON()s in replace_path to ASSERT()s Date: Thu, 20 May 2021 11:18:56 +0200 Message-Id: <20210520092121.613364104@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik [ Upstream commit 7a9213a93546e7eaef90e6e153af6b8fc7553f10 ] A few BUG_ON()'s in replace_path are purely to keep us from making logical mistakes, so replace them with ASSERT()'s. Reviewed-by: Qu Wenruo Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/relocation.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index c01239d1f1e6..313547442a6e 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1808,8 +1808,8 @@ int replace_path(struct btrfs_trans_handle *trans, int ret; int slot; - BUG_ON(src->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID); - BUG_ON(dest->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID); + ASSERT(src->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID); + ASSERT(dest->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID); last_snapshot = btrfs_root_last_snapshot(&src->root_item); again: @@ -1841,7 +1841,7 @@ again: parent = eb; while (1) { level = btrfs_header_level(parent); - BUG_ON(level < lowest_level); + ASSERT(level >= lowest_level); ret = btrfs_bin_search(parent, &key, level, &slot); if (ret && slot > 0) -- 2.30.2