From b13cc9686c5497cf1e5971689d1112056ee10651 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 8 Sep 2015 22:34:23 +0200 Subject: Fix append issue --- pathfs_frontend/file.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3