From c4ef68bbbd182901d861d3f9c413d9c8a509b926 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 18 Nov 2026 21:26:56 +0100 Subject: reverse: virtualconf: replace ReadResultFd 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 --- internal/fusefrontend_reverse/virtualconf.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal') 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 { -- cgit v1.2.3