mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 03:54:02 +00:00
Btrfs: add an assert to btrfs_lookup_csums_range for alignment
I was hitting weird issues when trying to remove hole extents and it turned out it was because I was sending non-aligned offsets down to btrfs_lookup_csums_range. So add an assert for this in case somebody trips over this in the future. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
ed9e8af88e
commit
4277a9c3b3
1 changed files with 3 additions and 0 deletions
|
@ -329,6 +329,9 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
|
||||||
u64 csum_end;
|
u64 csum_end;
|
||||||
u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy);
|
u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy);
|
||||||
|
|
||||||
|
ASSERT(start == ALIGN(start, root->sectorsize) &&
|
||||||
|
(end + 1) == ALIGN(end + 1, root->sectorsize));
|
||||||
|
|
||||||
path = btrfs_alloc_path();
|
path = btrfs_alloc_path();
|
||||||
if (!path)
|
if (!path)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Reference in a new issue