summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bcache/fs-io.c5
-rw-r--r--drivers/md/bcache/io.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/bcache/fs-io.c b/drivers/md/bcache/fs-io.c
index 654567ccaae1..3cc53a41c516 100644
--- a/drivers/md/bcache/fs-io.c
+++ b/drivers/md/bcache/fs-io.c
@@ -517,6 +517,9 @@ do_io:
bch_writepage_io_alloc(w, ei, page);
+ if (wbc->sync_mode == WB_SYNC_ALL)
+ w->io->bio.bio.bio.bi_opf |= WRITE_SYNC;
+
/*
* Before unlocking the page, transfer refcounts to w->io:
*/
@@ -575,7 +578,7 @@ int bch_writepage(struct page *page, struct writeback_control *wbc)
.io = NULL,
};
- ret = __bch_writepage(page, NULL, &w);
+ ret = __bch_writepage(page, wbc, &w);
if (ret)
return ret;
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
index 5ef15ed1cfea..ead91726dbc1 100644
--- a/drivers/md/bcache/io.c
+++ b/drivers/md/bcache/io.c
@@ -886,6 +886,8 @@ static void bch_write_extent(struct bch_write_op *op,
bio = bio_compress(c, orig,
&compression_type,
output_available);
+ /* copy WRITE_SYNC flag */
+ bio->bi_opf = orig->bi_opf;
orig->bi_iter.bi_size += extra_input;