提交 56e1edb0 编写于 作者: J Josef Bacik 提交者: David Sterba

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: NFilipe Manana <fdmanana@suse.com>
Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 71d18b53
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册