aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index b189bd1e7a3e..6aad98cb343f 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -132,9 +132,8 @@ static int check_compressed_csum(struct inode *inode,
132 printk(KERN_INFO "btrfs csum failed ino %llu " 132 printk(KERN_INFO "btrfs csum failed ino %llu "
133 "extent %llu csum %u " 133 "extent %llu csum %u "
134 "wanted %u mirror %d\n", 134 "wanted %u mirror %d\n",
135 (unsigned long long)btrfs_ino(inode), 135 btrfs_ino(inode), disk_start, csum, *cb_sum,
136 (unsigned long long)disk_start, 136 cb->mirror_num);
137 csum, *cb_sum, cb->mirror_num);
138 ret = -EIO; 137 ret = -EIO;
139 goto fail; 138 goto fail;
140 } 139 }
@@ -639,7 +638,11 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
639 faili = nr_pages - 1; 638 faili = nr_pages - 1;
640 cb->nr_pages = nr_pages; 639 cb->nr_pages = nr_pages;
641 640
642 add_ra_bio_pages(inode, em_start + em_len, cb); 641 /* In the parent-locked case, we only locked the range we are
642 * interested in. In all other cases, we can opportunistically
643 * cache decompressed data that goes beyond the requested range. */
644 if (!(bio_flags & EXTENT_BIO_PARENT_LOCKED))
645 add_ra_bio_pages(inode, em_start + em_len, cb);
643 646
644 /* include any pages we added in add_ra-bio_pages */ 647 /* include any pages we added in add_ra-bio_pages */
645 uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE; 648 uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE;