diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-12-03 17:18:16 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-01-07 14:18:25 +0100 |
commit | 56e1edb0e3334db479b8400abc5a9c03602e5ae8 (patch) | |
tree | 9b77d1f61311d34e2807b43db4bdafb6d1f0e217 /fs/btrfs/inode-item.c | |
parent | 71d18b53540f106a394cb35ed93b487b76678b06 (diff) | |
download | linux-56e1edb0e3334db479b8400abc5a9c03602e5ae8.tar.gz linux-56e1edb0e3334db479b8400abc5a9c03602e5ae8.tar.bz2 linux-56e1edb0e3334db479b8400abc5a9c03602e5ae8.zip |
btrfs: convert BUG_ON() in btrfs_truncate_inode_items to ASSERT
We have a correctness BUG_ON() in btrfs_truncate_inode_items to make
sure that we're always using min_type == BTRFS_EXTENT_DATA_KEY if
new_size is > 0. Convert this to an ASSERT.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r-- | fs/btrfs/inode-item.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index 44db08e46a49..9356edb75ab4 100644 --- a/fs/btrfs/inode-item.c +++ b/fs/btrfs/inode-item.c @@ -476,7 +476,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, bool should_throttle = false; ASSERT(control->inode || !control->clear_extent_range); - BUG_ON(new_size > 0 && control->min_type != BTRFS_EXTENT_DATA_KEY); + ASSERT(new_size == 0 || control->min_type == BTRFS_EXTENT_DATA_KEY); control->last_size = new_size; control->sub_bytes = 0; |