aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pathfs_frontend/file.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pathfs_frontend/file.go b/pathfs_frontend/file.go
index d94fe1b..6e7b4a1 100644
--- a/pathfs_frontend/file.go
+++ b/pathfs_frontend/file.go
@@ -56,6 +56,7 @@ func (f *file) doRead(off uint64, length uint64) ([]byte, fuse.Status) {
// Read the backing ciphertext in one go
alignedOffset, alignedLength, skip := f.cfs.CiphertextRange(off, length)
+ cryptfs.Debug.Printf("CiphertextRange(%d, %d) -> %d, %d, %d\n", off, length, alignedOffset, alignedLength, skip)
ciphertext := make([]byte, int(alignedLength))
n, err := f.fd.ReadAt(ciphertext, int64(alignedOffset))
ciphertext = ciphertext[0:n]
@@ -121,7 +122,7 @@ func (f *file) Write(data []byte, off int64) (uint32, fuse.Status) {
if b.IsPartial() {
// Read
o, _ := b.PlaintextRange()
- oldData, status := f.doRead(f.cfs.PlainBS(), o)
+ oldData, status := f.doRead(o, f.cfs.PlainBS())
if status != fuse.OK {
cryptfs.Warn.Printf("RMW read failed: %s\n", status.String())
return written, status