aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@gmail.com>2013-10-28 12:30:29 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:10:42 -0500
commit488111aa0e17102d42e0328299fd782dc6a4a051 (patch)
tree86b4d00e04802149d689db8a62d2c514fb05fed0 /fs/btrfs/tree-log.c
parente46f5388cdde0f402f2dded6f1cad614536c6429 (diff)
Btrfs: fix csum search offset/length calculation in log tree
We were setting the csums search offset and length to the right values if the extent is compressed, but later on right before doing the csums lookup we were overriding these two parameters regardless of compression being set or not for the extent. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 257cbae8c948..18891c009641 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3421,11 +3421,6 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
3421 if (skip_csum) 3421 if (skip_csum)
3422 return 0; 3422 return 0;
3423 3423
3424 if (em->compress_type) {
3425 csum_offset = 0;
3426 csum_len = block_len;
3427 }
3428
3429 /* 3424 /*
3430 * First check and see if our csums are on our outstanding ordered 3425 * First check and see if our csums are on our outstanding ordered
3431 * extents. 3426 * extents.
@@ -3509,8 +3504,13 @@ unlocked:
3509 if (!mod_len || ret) 3504 if (!mod_len || ret)
3510 return ret; 3505 return ret;
3511 3506
3512 csum_offset = mod_start - em->start; 3507 if (em->compress_type) {
3513 csum_len = mod_len; 3508 csum_offset = 0;
3509 csum_len = block_len;
3510 } else {
3511 csum_offset = mod_start - em->start;
3512 csum_len = mod_len;
3513 }
3514 3514
3515 /* block start is already adjusted for the file extent offset. */ 3515 /* block start is already adjusted for the file extent offset. */
3516 ret = btrfs_lookup_csums_range(log->fs_info->csum_root, 3516 ret = btrfs_lookup_csums_range(log->fs_info->csum_root,