Merge branch 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs...
authorChris Mason <chris.mason@fusionio.com>
Sat, 18 May 2013 01:53:17 +0000 (21:53 -0400)
committerChris Mason <chris.mason@fusionio.com>
Sat, 18 May 2013 01:53:17 +0000 (21:53 -0400)
1  2 
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/volumes.c

Simple merge
index fe1d6c3424a54618468ca36adf175e3e14960146,ca4355ddea06e67ab2faad16e54e0080038c1c59..b306b3a88fc7512248aa5a29e93ec57a2fca1d0f
@@@ -2470,20 -2436,25 +2449,26 @@@ static void end_bio_extent_readpage(str
                struct page *page = bvec->bv_page;
                struct extent_state *cached = NULL;
                struct extent_state *state;
 +              struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
  
                pr_debug("end_bio_extent_readpage: bi_sector=%llu, err=%d, "
 -                       "mirror=%ld\n", (u64)bio->bi_sector, err,
 -                       (long int)bio->bi_bdev);
 +                       "mirror=%lu\n", (u64)bio->bi_sector, err,
 +                       io_bio->mirror_num);
                tree = &BTRFS_I(page->mapping->host)->io_tree;
  
-               start = page_offset(page) + bvec->bv_offset;
-               end = start + bvec->bv_len - 1;
+               /* We always issue full-page reads, but if some block
+                * in a page fails to read, blk_update_request() will
+                * advance bv_offset and adjust bv_len to compensate.
+                * Print a warning for nonzero offsets, and an error
+                * if they don't add up to a full page.  */
+               if (bvec->bv_offset || bvec->bv_len != PAGE_CACHE_SIZE)
+                       printk("%s page read in btrfs with offset %u and length %u\n",
+                              bvec->bv_offset + bvec->bv_len != PAGE_CACHE_SIZE
+                              ? KERN_ERR "partial" : KERN_INFO "incomplete",
+                              bvec->bv_offset, bvec->bv_len);
  
-               if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE)
-                       whole_page = 1;
-               else
-                       whole_page = 0;
+               start = page_offset(page);
+               end = start + bvec->bv_offset + bvec->bv_len - 1;
  
                if (++bvec <= bvec_end)
                        prefetchw(&bvec->bv_page->flags);
Simple merge
Simple merge