btrfs: convert BUG_ON(EXTENT_BIT_LOCKED) checks to ASSERT's
authorJosef Bacik <josef@toxicpanda.com>
Fri, 9 Sep 2022 21:53:22 +0000 (17:53 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:28:03 +0000 (12:28 +0200)
We only call these functions from the qgroup code which doesn't call
with EXTENT_BIT_LOCKED.  These are BUG_ON()'s that exist to keep us
developers from using these functions with EXTENT_BIT_LOCKED, so convert
them to ASSERT()'s.

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/extent_io.c

index a6d7d5c..c600428 100644 (file)
@@ -1293,7 +1293,7 @@ int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
         * either fail with -EEXIST or changeset will record the whole
         * range.
         */
-       BUG_ON(bits & EXTENT_LOCKED);
+       ASSERT(!(bits & EXTENT_LOCKED));
 
        return set_extent_bit(tree, start, end, bits, 0, NULL, NULL, GFP_NOFS,
                              changeset);
@@ -1321,7 +1321,7 @@ int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
         * Don't support EXTENT_LOCKED case, same reason as
         * set_record_extent_bits().
         */
-       BUG_ON(bits & EXTENT_LOCKED);
+       ASSERT(!(bits & EXTENT_LOCKED));
 
        return __clear_extent_bit(tree, start, end, bits, 0, 0, NULL, GFP_NOFS,
                                  changeset);