summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/fusefrontend/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index a1f4f15..30e6e3d 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -181,6 +181,11 @@ func (f *file) doRead(dst []byte, off uint64, length uint64) ([]byte, fuse.Statu
tlog.Warn.Printf("read: ReadAt: %s", err.Error())
return nil, fuse.ToStatus(err)
}
+ // The ReadAt came back empty. We can skip all the decryption and return early.
+ if n == 0 {
+ f.fs.contentEnc.CReqPool.Put(ciphertext)
+ return dst, fuse.OK
+ }
// Truncate ciphertext buffer down to actually read bytes
ciphertext = ciphertext[0:n]