cache=none results in skipping the host page cache. So we can ignore
the tsyncfs request.

Signed-off-by: Aneesh Kumar K.V <aneesh.ku...@linux.vnet.ibm.com>
---
 hw/9pfs/virtio-9p.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 75df1a1..dceefd5 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -331,7 +331,10 @@ static int v9fs_do_lremovexattr(V9fsState *s, V9fsString 
*path,
 
 static int v9fs_do_syncfs(V9fsState *s, int fd)
 {
-    return s->ops->syncfs(&s->ctx, fd);
+    if (!(s->ctx.open_flags & O_SYNC)) {
+        return s->ops->syncfs(&s->ctx, fd);
+    }
+    return 0;
 }
 
 static void v9fs_string_init(V9fsString *str)
-- 
1.7.1


Reply via email to