Merge tag 'xfs-for-linus-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / fs / xfs / xfs_aops.c
index ebfde55..7575cfc 100644 (file)
@@ -447,7 +447,8 @@ xfs_submit_ioend(
 
        ioend->io_bio->bi_private = ioend;
        ioend->io_bio->bi_end_io = xfs_end_bio;
-
+       bio_set_op_attrs(ioend->io_bio, REQ_OP_WRITE,
+                        (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : 0);
        /*
         * If we are failing the IO now, just mark the ioend with an
         * error and finish it. This will run IO completion immediately
@@ -460,8 +461,7 @@ xfs_submit_ioend(
                return status;
        }
 
-       submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE,
-                  ioend->io_bio);
+       submit_bio(ioend->io_bio);
        return 0;
 }
 
@@ -519,8 +519,9 @@ xfs_chain_bio(
 
        bio_chain(ioend->io_bio, new);
        bio_get(ioend->io_bio);         /* for xfs_destroy_ioend */
-       submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE,
-                  ioend->io_bio);
+       bio_set_op_attrs(ioend->io_bio, REQ_OP_WRITE,
+                         (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : 0);
+       submit_bio(ioend->io_bio);
        ioend->io_bio = new;
 }