]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
Btrfs: use right range to find checksum for compressed extents
authorLiu Bo <bo.li.liu@oracle.com>
Sun, 6 Jan 2013 03:38:22 +0000 (03:38 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Thu, 24 Jan 2013 17:51:17 +0000 (12:51 -0500)
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>
fs/btrfs/tree-log.c

index de8899b04d6938b0ca2e9fce698d626f0a82e0f0..9027bb1e74660758328a3d133fe58b59ddc460e6 100644 (file)
@@ -3357,6 +3357,11 @@ 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;
+       }
+
        /* block start is already adjusted for the file extent offset. */
        ret = btrfs_lookup_csums_range(log->fs_info->csum_root,
                                       em->block_start + csum_offset,