aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-07-23 14:47:29 +0800
committerDavid Sterba <dsterba@suse.com>2018-08-06 13:12:56 +0200
commit5e23a6fea6189d1f9d6e6ca5cb3290b4a0fe2d48 (patch)
treed86cdb3c3dfb9eb2fa6e1e42e5dad7e5f5963058 /fs/btrfs
parentBtrfs: remove unused key assignment when doing a full send (diff)
downloadlinux-dev-5e23a6fea6189d1f9d6e6ca5cb3290b4a0fe2d48.tar.xz
linux-dev-5e23a6fea6189d1f9d6e6ca5cb3290b4a0fe2d48.zip
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index fd109bfd528d..c71aa118679d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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);