]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Comment and log change on torrentfs behaviour change
authorMatt Joiner <anacrolix@gmail.com>
Sun, 21 Feb 2021 23:10:43 +0000 (10:10 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 21 Feb 2021 23:10:43 +0000 (10:10 +1100)
fs/file_handle.go

index 0ba6d2e8decb81e12e6252f2ea92ebf9a583a389..64aeebef9a2dc5604a46f78b0aae3c3c2c3195fb 100644 (file)
@@ -3,7 +3,6 @@ package torrentfs
 import (
        "context"
        "io"
-       "log"
 
        "bazil.org/fuse"
        "bazil.org/fuse/fs"
@@ -47,8 +46,12 @@ func (me fileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse
                me.fn.FS.mu.Unlock()
                var n int
                r := missinggo.ContextedReader{r, ctx}
-               log.Printf("reading %v bytes at %v", len(resp.Data), req.Offset)
+               //log.Printf("reading %v bytes at %v", len(resp.Data), req.Offset)
                if true {
+                       // A user reported on that on freebsd 12.2, the system requires that reads are
+                       // completely filled. Their system only asks for 64KiB at a time. I've seen systems that
+                       // can demand up to 16MiB at a time, so this gets tricky. For now, I'll restore the old
+                       // behaviour from before 2a7352a, which nobody reported problems with.
                        n, readErr = io.ReadFull(r, resp.Data)
                } else {
                        n, readErr = r.Read(resp.Data)