aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-12-08 19:15:39 -0500
committerChris Mason <chris.mason@oracle.com>2008-12-08 19:15:39 -0500
commit580afd76e451deb6772d0507de580fb1df14da6c (patch)
treeea112be78807b07f617efffefb532e19778dc9bb /fs
parentc3027eb5523d6983f12628f3fe13d8a7576db701 (diff)
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')
-rw-r--r--fs/btrfs/file.c3
-rw-r--r--fs/btrfs/tree-log.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index b5a6a2b6f668..71bfe3a6a444 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1228,7 +1228,8 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
1228 mutex_unlock(&root->fs_info->trans_mutex); 1228 mutex_unlock(&root->fs_info->trans_mutex);
1229 1229
1230 root->fs_info->tree_log_batch++; 1230 root->fs_info->tree_log_batch++;
1231 filemap_fdatawait(inode->i_mapping); 1231 filemap_fdatawrite(inode->i_mapping);
1232 btrfs_wait_ordered_range(inode, 0, (u64)-1);
1232 root->fs_info->tree_log_batch++; 1233 root->fs_info->tree_log_batch++;
1233 1234
1234 /* 1235 /*
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,
2610 u64 cs = btrfs_file_extent_offset(src, extent); 2610 u64 cs = btrfs_file_extent_offset(src, extent);
2611 u64 cl = btrfs_file_extent_num_bytes(src, 2611 u64 cl = btrfs_file_extent_num_bytes(src,
2612 extent);; 2612 extent);;
2613 if (btrfs_file_extent_compression(src,
2614 extent)) {
2615 cs = 0;
2616 cl = dl;
2617 }
2613 /* ds == 0 is a hole */ 2618 /* ds == 0 is a hole */
2614 if (ds != 0) { 2619 if (ds != 0) {
2615 ret = btrfs_inc_extent_ref(trans, log, 2620 ret = btrfs_inc_extent_ref(trans, log,