summaryrefslogtreecommitdiff
path: root/pathfs_frontend
diff options
context:
space:
mode:
Diffstat (limited to 'pathfs_frontend')
-rw-r--r--pathfs_frontend/file.go3
-rw-r--r--pathfs_frontend/fs.go2
-rw-r--r--pathfs_frontend/fs_dir.go4
-rw-r--r--pathfs_frontend/names.go1
4 files changed, 4 insertions, 6 deletions
diff --git a/pathfs_frontend/file.go b/pathfs_frontend/file.go
index 1470da2..cf6b192 100644
--- a/pathfs_frontend/file.go
+++ b/pathfs_frontend/file.go
@@ -261,7 +261,6 @@ func (f *file) doWrite(data []byte, off int64) (uint32, fuse.Status) {
cryptfs.Debug.Printf("len(oldData)=%d len(blockData)=%d\n", len(oldData), len(blockData))
}
- // Write
blockOffset, blockLen := b.CiphertextRange()
blockData = f.cfs.EncryptBlock(blockData, b.BlockNo, f.header.Id)
cryptfs.Debug.Printf("ino%d: Writing %d bytes to block #%d, md5=%s\n",
@@ -276,6 +275,8 @@ func (f *file) doWrite(data []byte, off int64) (uint32, fuse.Status) {
status = fuse.ToStatus(err)
break
}
+
+ // Write
f.fdLock.Lock()
_, err = f.fd.WriteAt(blockData, int64(blockOffset))
f.fdLock.Unlock()
diff --git a/pathfs_frontend/fs.go b/pathfs_frontend/fs.go
index c7a9888..f853556 100644
--- a/pathfs_frontend/fs.go
+++ b/pathfs_frontend/fs.go
@@ -244,8 +244,6 @@ func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status f
return string(target), fuse.OK
}
-
-
func (fs *FS) Unlink(path string, context *fuse.Context) (code fuse.Status) {
if fs.isFiltered(path) {
return fuse.EPERM
diff --git a/pathfs_frontend/fs_dir.go b/pathfs_frontend/fs_dir.go
index 95257bb..9b319f8 100644
--- a/pathfs_frontend/fs_dir.go
+++ b/pathfs_frontend/fs_dir.go
@@ -1,10 +1,10 @@
package pathfs_frontend
import (
+ "fmt"
"os"
"path/filepath"
"syscall"
- "fmt"
"github.com/hanwen/go-fuse/fuse"
"github.com/rfjakob/gocryptfs/cryptfs"
@@ -85,7 +85,7 @@ func (fs *FS) Rmdir(name string, context *fuse.Context) (code fuse.Status) {
cryptfs.Debug.Printf("Rmdir: Chmod failed: %v\n", err2)
return fuse.ToStatus(err)
}
- defer func () {
+ defer func() {
if code != fuse.OK {
// Undo the chmod if removing the directory failed
err3 := os.Chmod(encPath, origMode)
diff --git a/pathfs_frontend/names.go b/pathfs_frontend/names.go
index e1783a6..219942e 100644
--- a/pathfs_frontend/names.go
+++ b/pathfs_frontend/names.go
@@ -24,7 +24,6 @@ func (fs *FS) isFiltered(path string) bool {
return false
}
-
// encryptPath - encrypt relative plaintext path
func (fs *FS) encryptPath(plainPath string) (string, error) {
if fs.args.PlaintextNames {