From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC2E6A35B for ; Thu, 8 Feb 2024 09:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707382829; cv=none; b=bOZyYCrId+cN6TU5PBaQc71D4vYscdzMLe3ujhh0ZbJwuPdl+2VlXUD6f8NG5WGs/2vea6pawvJEfArL+gpRUfgccNBCCm8owmJfS+n/ynXnzyKYwR3PDwsErTB9GOEUrmXz2wVmAsL69wqwQL+x4lXk0ccpjbCNumUnY8+pJ4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707382829; c=relaxed/simple; bh=cjg9Y4ZcCQEO3Rn1hc2vP+XTr7NF+vYWh6Y1jbXCTmM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c+LxPMjQhia0WQTa8r50EJXtHtiVOk9njjcc79lnJqaQb4iHNNAcKnslLOgjI33hten+2dD/e1idlbLaK59r/iqeIhpUTLgeP5XBdHGy5ArqhkRyEKwTBhSio/cwRGuTyKSrTuu/i+lvzpxKiQD6UwZBGPDNnIWCb7wVzdMGlEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 342A31FD56; Thu, 8 Feb 2024 09:00:26 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2EB9513984; Thu, 8 Feb 2024 09:00:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Ra9mCyqYxGWMDgAAD6G6ig (envelope-from ); Thu, 08 Feb 2024 09:00:26 +0000 From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 09/14] btrfs: change BUG_ON to assertion in tree_move_down() Date: Thu, 8 Feb 2024 09:59:57 +0100 Message-ID: <513e4f7646b52d79f2bf37eaafc39c9cd074a475.1707382595.git.dsterba@suse.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 342A31FD56 X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO There's only one caller of tree_move_down() that does not pass level 0 so the assertion is better suited here. Signed-off-by: David Sterba --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 7a601de7fa7c..e96d511f9dd9 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -7438,8 +7438,8 @@ static int tree_move_down(struct btrfs_path *path, int *level, u64 reada_min_gen u64 reada_done = 0; lockdep_assert_held_read(&parent->fs_info->commit_root_sem); + ASSERT(*level != 0); - BUG_ON(*level == 0); eb = btrfs_read_node_slot(parent, slot); if (IS_ERR(eb)) return PTR_ERR(eb); -- 2.42.1