Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2476366pxj; Mon, 10 May 2021 04:02:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytxKXe2iDXFu0tHbOF/4hFTT7Yf7d9vJyg+GEUdB1DGiF2uo8i0zQ6iwVGm7YOVUJEG7Zz X-Received: by 2002:a17:906:b0cb:: with SMTP id bk11mr25435679ejb.310.1620644568418; Mon, 10 May 2021 04:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644568; cv=none; d=google.com; s=arc-20160816; b=liF+Vrf31APZGr7f05BHpRn31OaPR1sj1Od/44b58hcLpXlHoNxbUozoAZ+tXmi/ax 9A3B8jgZEHwM3q/ZiqbtrktuOhecsg+LINZt8TasQGVblQm4/z1xVcjoTLXnHNamp3AZ D70l/txTg2egDxps/3I81z/NmLD+eb3eko2GnjBIbt6AeKVU8AwXFWqr5yO5Xthr9xJK fHwZJUqHpAI3hKXfMLlwnzeIQbAoUtTf4fd9Ia94P3A3tiezSFUX22yebUGZZpbs9NI4 itEjvaaRUncD7tIoSLxy6LOtMLeqMJ6Wtv8vDGuRMXBjulUFJ88YB9ZO4Kchd8ds0ywV zymg== 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=ANspEjoMkP4ZAag7HT4afaEA3H9SqPUy55fGHOezrX4=; b=MLS87qpf/lA8/vCgcujmIsp9MzsLeBsaEXaTex+uscSas+j24EgUqxXkFvtj+OJzPe UMNylPIbPUcw54bMzZmYTPLsfJHgwTq9uNeZkaTCnONFEULZA1FyusZmDumoFiw7/wAm jHM4JdWO3l8uSYT9o2g1TfsneMHecQIXz9B8pHLQm2XsL3Ku4SBlKXMadM2K284ZSxa4 docsaJlTYO15yckoy7JrV28MofIVIZkNzbs7scK5X3OIURhEJ9YE9Vqi1lh7cFJdr2eP WMSk1Go834fc6L6hSen9PPW0jwq2Mb8NQ3o5HLG8fl2eEEELggh/+7J2L/WpoOev/w1P +I+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vL3+UqZC; 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 nb19si753678ejc.129.2021.05.10.04.02.23; Mon, 10 May 2021 04:02:48 -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=vL3+UqZC; 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 S235546AbhEJLBU (ORCPT + 99 others); Mon, 10 May 2021 07:01:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233290AbhEJKpf (ORCPT ); Mon, 10 May 2021 06:45:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 21B7B61991; Mon, 10 May 2021 10:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642939; bh=rlXmFOD0y2mNjZoH0cAdD4CXpr/t0xyYl2OHjmqDCC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vL3+UqZCnPqEcPZbTJJ8dWQfbCJqGquupUnxE5VAdfzkkwDwd+1KWrV0IB4oJgvxw 9DYFoLP4ha4EPjAepBK4NArTk0QxmgnTvVqQ+sZaVSRQN3Gn8OpaVBFJ5Ugtl2np0V WqBzZfCO5kYMpcOSwPOzekZn/75rdx/E7KGvtetw= 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 5.10 112/299] btrfs: convert logic BUG_ON()s in replace_path to ASSERT()s Date: Mon, 10 May 2021 12:18:29 +0200 Message-Id: <20210510102008.655805899@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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 b3368cfccabf..c21545c5b34b 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1205,8 +1205,8 @@ int replace_path(struct btrfs_trans_handle *trans, struct reloc_control *rc, 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: @@ -1241,7 +1241,7 @@ again: struct btrfs_key first_key; level = btrfs_header_level(parent); - BUG_ON(level < lowest_level); + ASSERT(level >= lowest_level); ret = btrfs_bin_search(parent, &key, &slot); if (ret < 0) -- 2.30.2