pve-qemu-qoup/debian/patches/pve/0019-block-rbd-disable-rbd_cache_writethrough_until_flush.patch
2017-09-08 09:44:31 +02:00

30 lines
888 B
Diff

From 24fea0d7356b39d70dde9eb683183ed5c67a4ac9 Mon Sep 17 00:00:00 2001
From: Alexandre Derumier <aderumier@odiso.com>
Date: Tue, 26 Jul 2016 16:51:00 +0200
Subject: [PATCH 19/28] block: rbd: disable rbd_cache_writethrough_until_flush
with cache=unsafe
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
block/rbd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/rbd.c b/block/rbd.c
index 2354ffcc64..b7700648ff 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -623,6 +623,10 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
rados_conf_set(s->cluster, "rbd_cache", "true");
}
+ if (flags & BDRV_O_NO_FLUSH) {
+ rados_conf_set(s->cluster, "rbd_cache_writethrough_until_flush", "false");
+ }
+
r = rados_connect(s->cluster);
if (r < 0) {
error_setg_errno(errp, -r, "error connecting");
--
2.11.0