[PATCH 2/3] 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 file changed, 3 insertions(+)

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;
 }
 
-- 
1.8.4



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