[gvfs] fuse: Enforce sync_read



commit 3e8cc556fe13a32518ebdd4c11a11f0006083844
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Wed Sep 25 20:42:34 2013 +0200

    fuse: Enforce sync_read
    
    When running multithreaded, fuse can issue readahead requests out of
    order which can cause subsequent reads to fail with ENOTSUPP (if seeking
    backward is not supported on the stream).
    
    Force readahead to occur in order to prevent this problem.

 client/gvfsfusedaemon.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index e8cada1..5763c1c 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -2391,6 +2391,9 @@ vfs_init (struct fuse_conn_info *conn)
   /* Indicate O_TRUNC support for open() */
   conn->want |= FUSE_CAP_ATOMIC_O_TRUNC;
 
+  /* Prevent out-of-order readahead */
+  conn->async_read = 0;
+
   return NULL;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]