[Sheepdog] [PATCH] sheep: use O_SYNC flag for opening objects

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Oct 25 07:12:54 CEST 2010


A sheepdog qemu block driver doesn't implement bdrv_flush(), so
sheepdog does not support writeback semantics now.  In this case,
opening object with O_SYNC and silently upgrade to writethrough
semantics is safe.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/store.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/store.c b/sheep/store.c
index a4d6155..06e35e7 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -596,7 +596,7 @@ out:
 static int ob_open(uint32_t epoch, uint64_t oid, int aflags, int *ret)
 {
 	char path[1024];
-	int flags = O_RDWR | aflags;
+	int flags = O_SYNC | O_RDWR | aflags;
 	int fd;
 
 	snprintf(path, sizeof(path), "%s%08u/%016" PRIx64, obj_path, epoch, oid);
-- 
1.5.6.5




More information about the sheepdog mailing list