summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-06-26 17:25:38 -0700
committerKent Overstreet <kmo@daterainc.com>2013-07-01 14:42:47 -0700
commite49c7c374e7aacd1f04ecbc21d9dbbeeea4a77d6 (patch)
tree3382c6a5512878494e9dfda787e142c3cddae470 /drivers/md/bcache/request.c
parentcecd628d9a9966ed0af1237df5cc5818945fe9f2 (diff)
downloadlwn-e49c7c374e7aacd1f04ecbc21d9dbbeeea4a77d6.tar.gz
lwn-e49c7c374e7aacd1f04ecbc21d9dbbeeea4a77d6.zip
bcache: FUA fixes
Journal writes need to be marked FUA, not just REQ_FLUSH. And btree node writes have... weird ordering requirements. Signed-off-by: Kent Overstreet <koverstreet@google.com>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r--drivers/md/bcache/request.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 17bd59704eba..bcdf1f782c3e 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -1035,8 +1035,19 @@ static void request_write(struct cached_dev *dc, struct search *s)
closure_bio_submit(bio, cl, s->d);
} else {
- s->op.cache_bio = bio;
bch_writeback_add(dc);
+
+ if (s->op.flush_journal) {
+ /* Also need to send a flush to the backing device */
+ s->op.cache_bio = bio_clone_bioset(bio, GFP_NOIO,
+ dc->disk.bio_split);
+
+ bio->bi_size = 0;
+ bio->bi_vcnt = 0;
+ closure_bio_submit(bio, cl, s->d);
+ } else {
+ s->op.cache_bio = bio;
+ }
}
out:
closure_call(&s->op.cl, bch_insert_data, NULL, cl);