summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-10-15 09:36:40 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 21:58:45 -0500
commit4277a9c3b3665f2830c55ece015163867b9414cc (patch)
treec87563bb9b275aa6cbd4c06ba64a7cdd98b68c27 /fs/btrfs/file-item.c
parented9e8af88e2551aaa6bf51d8063a2493e2d71597 (diff)
downloadlinux-4277a9c3b3665f2830c55ece015163867b9414cc.tar.gz
linux-4277a9c3b3665f2830c55ece015163867b9414cc.tar.bz2
linux-4277a9c3b3665f2830c55ece015163867b9414cc.zip
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>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 4f53159bdb9d..ae8a5139e0ee 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -329,6 +329,9 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
u64 csum_end;
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();
if (!path)
return -ENOMEM;