diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e90d7c597ef3a651a15458b8b3108a02065c6d3e..28491a82e6456fdf3b1ba1c350bcd74240f06976 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -978,6 +978,7 @@ static noinline int cow_file_range(struct inode *inode, num_bytes = ALIGN(end - start + 1, blocksize); num_bytes = max(blocksize, num_bytes); + ASSERT(num_bytes <= btrfs_super_total_bytes(fs_info->super_copy)); inode_should_defrag(BTRFS_I(inode), start, end, num_bytes, SZ_64K); @@ -1008,8 +1009,6 @@ static noinline int cow_file_range(struct inode *inode, } } - BUG_ON(num_bytes > btrfs_super_total_bytes(fs_info->super_copy)); - alloc_hint = get_extent_allocation_hint(inode, start, num_bytes); btrfs_drop_extent_cache(BTRFS_I(inode), start, start + num_bytes - 1, 0);