Merge tag 'samsung-fixes-4.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / fs / mpage.c
index 37b2828..d2413af 100644 (file)
@@ -50,7 +50,7 @@ static void mpage_end_io(struct bio *bio)
 
        bio_for_each_segment_all(bv, bio, i) {
                struct page *page = bv->bv_page;
-               page_endio(page, bio_data_dir(bio), bio->bi_error);
+               page_endio(page, op_is_write(bio_op(bio)), bio->bi_error);
        }
 
        bio_put(bio);
@@ -72,6 +72,8 @@ mpage_alloc(struct block_device *bdev,
 {
        struct bio *bio;
 
+       /* Restrict the given (page cache) mask for slab allocations */
+       gfp_flags &= GFP_KERNEL;
        bio = bio_alloc(gfp_flags, nr_vecs);
 
        if (bio == NULL && (current->flags & PF_MEMALLOC)) {
@@ -363,7 +365,7 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages,
        sector_t last_block_in_bio = 0;
        struct buffer_head map_bh;
        unsigned long first_logical_block = 0;
-       gfp_t gfp = mapping_gfp_constraint(mapping, GFP_KERNEL);
+       gfp_t gfp = readahead_gfp_mask(mapping);
 
        map_bh.b_state = 0;
        map_bh.b_size = 0;