Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp608985pxj; Thu, 20 May 2021 17:45:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP1W2hlP+RcqrG7Gb8yuGS6Bt0Pqgeph4G3M7sPhKQ2mib+P1vDdMKm5DwwGYpOk3IsE5D X-Received: by 2002:a17:906:6549:: with SMTP id u9mr7111606ejn.506.1621557926712; Thu, 20 May 2021 17:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621557926; cv=none; d=google.com; s=arc-20160816; b=pUAqYeEDhUeG5zL0hXMDwOYauV1v+vVJGLDR4lp9L5NJ/6LwHm8A4IepX8lFFrPJf3 R6IxJ7dNDEyOBmM5kTNZyW1Mya3Dvgc7vna54til6clCdrriNRmU3EXkGN2qmIylxHqP ssQKx2Kl7C0xUv+6upIdaAb0GZo6engtvIboNYu7eHHVMVOUH2o49W9vh80S2/O6xq6S 0UvXtim2JvQG8U2LcAo4dpPD+2wVoV1jDw6Pt0O+Q5EGOtYKdblueswD6AUVpZRTjEbL zZ6pXWXgQ+UymPGxlyUj2H+prq952ta6mWM6I/M+rN7jdqE7lcYy0Uak/TRpIWmo52nr qEYg== 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=xegsX2PKDt5W24PfHMZOEvUV0+IsL97vk2o51TBYmk8=; b=AVJDc8xghfiFWKAuY4WQLnZwv7bHRhRE3LIdXlAQUe5AkcUCW7Wo3flKb282WiI9WQ Hn7rDhv0F9J/q95P2Bvoa0Uxjz5lowzWAQ9+yrnAX1WPpQCfICe+gQwzuYeSJK70oMsP vi3bQVkP0XDWC0S8pG0MFSWxSp3BACtpTbkr4OLb8vY5ju6HNn4nDSYqHi1DNMBngtWP Mytgf5nINU5DMpmGicH2LuPqCNkwg8/tYmXufcGKqyM5Dvl1pfzcNzyEv4J2AkKMqk+c zLVomoXTAYadPpSa33wXrFrWpRKpOoK6wyadei94U+FXWzzL5VqTAU2JNHa4rNr7Qriw wG3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=THDyGSPG; 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 l23si2138500ejb.573.2021.05.20.17.45.03; Thu, 20 May 2021 17:45:26 -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=THDyGSPG; 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 S241038AbhETL27 (ORCPT + 99 others); Thu, 20 May 2021 07:28:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:53584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237701AbhETLJA (ORCPT ); Thu, 20 May 2021 07:09:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F062961D36; Thu, 20 May 2021 10:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505192; bh=sQFIf3GjQdhh820FKymVWIfyfTPx46OKo/3et9g+dmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THDyGSPG3MqrMkPZ4gSCg8ys9khhO4IQ5DYztdHQdiIUxfuRhXNeeOKGvq3GJUQpE c8eRVuI2tIImzzr981IPPy1L76H+1YT884sx5bu9XYBPJauVpgCkDrsYTHuVUjoMwx ukqks7aSaOpYrjModllly9SyMmsyZCAdOV1t5HDc= 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.4 023/190] btrfs: convert logic BUG_ON()s in replace_path to ASSERT()s Date: Thu, 20 May 2021 11:21:27 +0200 Message-Id: <20210520092102.936808325@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 5681fc3976ad..628b6a046093 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1785,8 +1785,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: @@ -1818,7 +1818,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