btrfs: extent-tree: Remove dead alignment check
authorQu Wenruo <wqu@suse.com>
Mon, 23 Jul 2018 06:47:29 +0000 (14:47 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:56 +0000 (13:12 +0200)
commit5e23a6fea6189d1f9d6e6ca5cb3290b4a0fe2d48
treed86cdb3c3dfb9eb2fa6e1e42e5dad7e5f5963058
parentca5d2ba1ae2dfd651b798218d56c3277784fa499
btrfs: extent-tree: Remove dead alignment check

In find_free_extent() under checks: label, we have the following code:

search_start = ALIGN(offset, fs_info->stripesize);
/* move on to the next group */
if (search_start + num_bytes >
    block_group->key.objectid + block_group->key.offset) {
btrfs_add_free_space(block_group, offset, num_bytes);
goto loop;
}
if (offset < search_start)
btrfs_add_free_space(block_group, offset,
     search_start - offset);
BUG_ON(offset > search_start);

However ALIGN() is rounding up, thus @search_start >= @offset and that
BUG_ON() will never be triggered.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c