diff options
author | Filipe David Borba Manana <fdmanana@gmail.com> | 2013-10-28 16:30:29 +0000 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 22:10:42 -0500 |
commit | 488111aa0e17102d42e0328299fd782dc6a4a051 (patch) | |
tree | 86b4d00e04802149d689db8a62d2c514fb05fed0 /fs/btrfs | |
parent | e46f5388cdde0f402f2dded6f1cad614536c6429 (diff) | |
download | linux-488111aa0e17102d42e0328299fd782dc6a4a051.tar.gz linux-488111aa0e17102d42e0328299fd782dc6a4a051.tar.bz2 linux-488111aa0e17102d42e0328299fd782dc6a4a051.zip |
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')
-rw-r--r-- | fs/btrfs/tree-log.c | 14 |
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, if (skip_csum) return 0; - if (em->compress_type) { - csum_offset = 0; - csum_len = block_len; - } - /* * First check and see if our csums are on our outstanding ordered * extents. @@ -3509,8 +3504,13 @@ unlocked: if (!mod_len || ret) return ret; - csum_offset = mod_start - em->start; - csum_len = mod_len; + if (em->compress_type) { + csum_offset = 0; + csum_len = block_len; + } else { + csum_offset = mod_start - em->start; + csum_len = mod_len; + } /* block start is already adjusted for the file extent offset. */ ret = btrfs_lookup_csums_range(log->fs_info->csum_root, |