diff options
author | Liu Bo <[email protected]> | 2013-01-06 03:38:22 +0000 |
---|---|---|
committer | Josef Bacik <[email protected]> | 2013-01-24 12:51:17 -0500 |
commit | 192000dda22e02225772e862b92e7c09e5a17d08 (patch) | |
tree | 5ebfe29a6aa6b47f869adb7bc84cc954b733102d | |
parent | b0175117b9376a69978bbe80af26fb95dddbd53e (diff) |
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 <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
-rw-r--r-- | fs/btrfs/tree-log.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index de8899b04d69..9027bb1e7466 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -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, |