Merge tag 'please-pull-misc-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / fs / mpage.c
index 3e79220babac28383c5c68cdb3580378d3324bcc..ca0244b69de8bad8939ebb904e8d90156a81773e 100644 (file)
@@ -605,6 +605,8 @@ alloc_new:
                                bio_get_nr_vecs(bdev), GFP_NOFS|__GFP_HIGH);
                if (bio == NULL)
                        goto confused;
+
+               wbc_init_bio(wbc, bio);
        }
 
        /*
@@ -612,6 +614,7 @@ alloc_new:
         * the confused fail path above (OOM) will be very confused when
         * it finds all bh marked clean (i.e. it will not write anything)
         */
+       wbc_account_io(wbc, page, PAGE_SIZE);
        length = first_unmapped << blkbits;
        if (bio_add_page(bio, page, length, 0) < length) {
                bio = mpage_bio_submit(WRITE, bio);