summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorChris Mason2008-12-09 01:15:39 +0100
committerChris Mason2008-12-09 01:15:39 +0100
commit580afd76e451deb6772d0507de580fb1df14da6c (patch)
treeea112be78807b07f617efffefb532e19778dc9bb /fs/btrfs/tree-log.c
parentBtrfs: Add inode sequence number for NFS and reserved space in a few structs (diff)
downloadkernel-qcow2-linux-580afd76e451deb6772d0507de580fb1df14da6c.tar.gz
kernel-qcow2-linux-580afd76e451deb6772d0507de580fb1df14da6c.tar.xz
kernel-qcow2-linux-580afd76e451deb6772d0507de580fb1df14da6c.zip
Btrfs: Fix compressed checksum fsync log copies
The fsync logging code makes sure to onl copy the relevant checksum for each extent based on the file extent pointers it finds. But for compressed extents, it needs to copy the checksum for the entire extent. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index d3f9c2c663c4..6ac1b7f72e2a 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2610,6 +2610,11 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
u64 cs = btrfs_file_extent_offset(src, extent);
u64 cl = btrfs_file_extent_num_bytes(src,
extent);;
+ if (btrfs_file_extent_compression(src,
+ extent)) {
+ cs = 0;
+ cl = dl;
+ }
/* ds == 0 is a hole */
if (ds != 0) {
ret = btrfs_inc_extent_ref(trans, log,