aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-11-18 21:26:56 +0100
committerJakob Unterwurzacher2026-11-18 21:31:03 +0100
commitc4ef68bbbd182901d861d3f9c413d9c8a509b926 (patch)
tree0c23d5aadcd080bd1fd09f07683008301ac58679 /internal/fusefrontend_reverse
parentb7843e85ed699fe597834ad60bffc2035a5bba2b (diff)
reverse: virtualconf: replace ReadResultFdHEADmaster
This is gocryptfs' only exposure to go-fuse's ReadResultFd, and it's causing problems: https://github.com/rfjakob/gocryptfs/issues/1053 : 22:39:30.990956 trySplice: splice: want 1052688 bytes, max pipe size 1048576 22:39:30.991863 trySplice: splice: want 1052688 bytes, max pipe size 1048576 22:39:30.994928 trySplice: splice: want 1052688 bytes, max pipe size 1048576 22:39:30.995764 trySplice: splice: want 1052688 bytes, max pipe size 1048576 22:39:30.998467 trySplice: splice: want 1052688 bytes, max pipe size 1048576 22:39:30.999395 trySplice: splice: want 1052688 bytes, max pipe size 1048576 Performance does not matter here. Just convert to a normal read. Fixes https://github.com/rfjakob/gocryptfs/issues/1053
Diffstat (limited to 'internal/fusefrontend_reverse')
-rw-r--r--internal/fusefrontend_reverse/virtualconf.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/virtualconf.go b/internal/fusefrontend_reverse/virtualconf.go
index 684cc59..6780974 100644
--- a/internal/fusefrontend_reverse/virtualconf.go
+++ b/internal/fusefrontend_reverse/virtualconf.go
@@ -97,8 +97,11 @@ type VirtualConfFile struct {
func (f *VirtualConfFile) Read(ctx context.Context, buf []byte, off int64) (res fuse.ReadResult, errno syscall.Errno) {
f.mu.Lock()
defer f.mu.Unlock()
- res = fuse.ReadResultFd(uintptr(f.fd), off, len(buf))
- return
+ n, err := syscall.Pread(f.fd, buf, off)
+ if err != nil {
+ return nil, fs.ToErrno(err)
+ }
+ return fuse.ReadResultData(buf[:n]), 0
}
func (f *VirtualConfFile) Release(ctx context.Context) syscall.Errno {