btrfs: introduce btrfs_subpage for data inodes
[linux-2.6-microblaze.git] / fs / btrfs / compression.c
index 5ae3fa0..6d203ac 100644 (file)
@@ -542,13 +542,19 @@ static noinline int add_ra_bio_pages(struct inode *inode,
                        goto next;
                }
 
-               end = last_offset + PAGE_SIZE - 1;
                /*
                 * at this point, we have a locked page in the page cache
                 * for these bytes in the file.  But, we have to make
                 * sure they map to this compressed extent on disk.
                 */
-               set_page_extent_mapped(page);
+               ret = set_page_extent_mapped(page);
+               if (ret < 0) {
+                       unlock_page(page);
+                       put_page(page);
+                       break;
+               }
+
+               end = last_offset + PAGE_SIZE - 1;
                lock_extent(tree, last_offset, end);
                read_lock(&em_tree->lock);
                em = lookup_extent_mapping(em_tree, last_offset,