]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/compression.c
Merge remote-tracking branch 'ext4/dev'
[karo-tx-linux.git] / fs / btrfs / compression.c
index b189bd1e7a3e45bf92002e35c8db525886c7593d..6aad98cb343fba0941b9044dabaa9e64697c7354 100644 (file)
@@ -132,9 +132,8 @@ static int check_compressed_csum(struct inode *inode,
                        printk(KERN_INFO "btrfs csum failed ino %llu "
                               "extent %llu csum %u "
                               "wanted %u mirror %d\n",
-                              (unsigned long long)btrfs_ino(inode),
-                              (unsigned long long)disk_start,
-                              csum, *cb_sum, cb->mirror_num);
+                              btrfs_ino(inode), disk_start, csum, *cb_sum,
+                              cb->mirror_num);
                        ret = -EIO;
                        goto fail;
                }
@@ -639,7 +638,11 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
        faili = nr_pages - 1;
        cb->nr_pages = nr_pages;
 
-       add_ra_bio_pages(inode, em_start + em_len, cb);
+       /* In the parent-locked case, we only locked the range we are
+        * interested in.  In all other cases, we can opportunistically
+        * cache decompressed data that goes beyond the requested range. */
+       if (!(bio_flags & EXTENT_BIO_PARENT_LOCKED))
+               add_ra_bio_pages(inode, em_start + em_len, cb);
 
        /* include any pages we added in add_ra-bio_pages */
        uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE;