[PATCH 1/3] fuse: Fix seek offset calculation



Since fh->pos is already incremented by n_bytes_skipped, check if
offset == fh->pos.

This error was hidden by the fact that the operation is retried when
-EIO is returned.  When it was retried, the stream was already in the
correct position and so no seek operation was required.
---
 client/gvfsfusedaemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index ce15a0e..e8cada1 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -1198,7 +1198,7 @@ read_stream (FileHandle *fh, gchar *output_buf, size_t output_buf_size, off_t of
           if (n_bytes_skipped > 0)
             fh->pos += n_bytes_skipped;
 
-          if (n_bytes_skipped != offset - fh->pos)
+          if (offset != fh->pos)
             {
               if (error)
                 {
-- 
1.8.4



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