mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
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>
This commit is contained in:
@@ -7564,7 +7564,7 @@ unclustered_alloc:
|
||||
goto loop;
|
||||
}
|
||||
checks:
|
||||
search_start = ALIGN(offset, fs_info->stripesize);
|
||||
search_start = round_up(offset, fs_info->stripesize);
|
||||
|
||||
/* move on to the next group */
|
||||
if (search_start + num_bytes >
|
||||
@@ -7576,7 +7576,6 @@ checks:
|
||||
if (offset < search_start)
|
||||
btrfs_add_free_space(block_group, offset,
|
||||
search_start - offset);
|
||||
BUG_ON(offset > search_start);
|
||||
|
||||
ret = btrfs_add_reserved_bytes(block_group, ram_bytes,
|
||||
num_bytes, delalloc);
|
||||
|
||||
Reference in New Issue
Block a user