]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: fix csum assert to check objectid of the root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 5 Nov 2021 20:45:46 +0000 (16:45 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:49 +0000 (15:09 +0100)
In the future we may have multiple csum roots, so simply check the
objectid is for a csum root instead of checking against ->csum_root.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c

index 0f2e2ab3482866ecd53cb57a52b5a47d434c787b..3acc8b2b5b8495d688f129fd50e48fe5d2283836 100644 (file)
@@ -801,7 +801,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
        const u32 csum_size = fs_info->csum_size;
        u32 blocksize_bits = fs_info->sectorsize_bits;
 
-       ASSERT(root == fs_info->csum_root ||
+       ASSERT(root->root_key.objectid == BTRFS_CSUM_TREE_OBJECTID ||
               root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID);
 
        path = btrfs_alloc_path();