]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
btrfs: change BUG_ON to assertion in btrfs_read_roots()
authorDavid Sterba <dsterba@suse.com>
Wed, 24 Jan 2024 00:09:46 +0000 (01:09 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:48 +0000 (16:24 +0100)
There's one caller of btrfs_read_roots() and that already uses the
tree_root pointer, it's pointless to BUG_ON on it. As it's an assumption
of the initialization helpers make it an assert instead.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c

index b056b7d0e526804db922465e1b9467de6cf44c21..0dfa3d4ed8abc5108a23acb8374e35c3842af469 100644 (file)
@@ -2239,7 +2239,7 @@ static int btrfs_read_roots(struct btrfs_fs_info *fs_info)
        struct btrfs_key location;
        int ret;
 
-       BUG_ON(!fs_info->tree_root);
+       ASSERT(fs_info->tree_root);
 
        ret = load_global_roots(tree_root);
        if (ret)