Skip to content

Commit 192000d

Browse files
Liu BoJosef Bacik
authored andcommitted
Btrfs: use right range to find checksum for compressed extents
For compressed extents, the range of checksum is covered by disk length, and the disk length is different with ram length, so we need to use disk length instead to get us the right checksum. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
1 parent b017511 commit 192000d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/btrfs/tree-log.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,6 +3357,11 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
33573357
if (skip_csum)
33583358
return 0;
33593359

3360+
if (em->compress_type) {
3361+
csum_offset = 0;
3362+
csum_len = block_len;
3363+
}
3364+
33603365
/* block start is already adjusted for the file extent offset. */
33613366
ret = btrfs_lookup_csums_range(log->fs_info->csum_root,
33623367
em->block_start + csum_offset,

0 commit comments

Comments
 (0)