aboutsummaryrefslogtreecommitdiff
path: root/cryptfs/names_diriv.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-01-25 00:51:28 +0100
committerJakob Unterwurzacher2016-01-25 00:51:28 +0100
commit4c9e249e3ac1fc2995e01eb1ed24799c3a3bc66b (patch)
tree97a9eb498ef70a3c00dd7bd8fafb4765abeecf5b /cryptfs/names_diriv.go
parent4259c8f7ebc9f5d167556ed142e82e8232706de6 (diff)
Convert fdLock to an RWMutex and protect the whole transaction
...against concurrent closes. The testcase (set -e; while true; do truncate -s $RANDOM b; done) & (set -e; while true; do truncate -s $RANDOM b; done) & uncovered lots of unnecessary RMW failures that were the result of concurrent closes. With this patch, the only remaining error is "Truncate on forgotten file" that is probably caused by a problem in the go-fuse lib ( https://github.com/hanwen/go-fuse/issues/95 )
Diffstat (limited to 'cryptfs/names_diriv.go')
-rw-r--r--cryptfs/names_diriv.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptfs/names_diriv.go b/cryptfs/names_diriv.go
index 9519ebc..45abfce 100644
--- a/cryptfs/names_diriv.go
+++ b/cryptfs/names_diriv.go
@@ -1,9 +1,9 @@
package cryptfs
import (
- "os"
"fmt"
"io/ioutil"
+ "os"
"path/filepath"
"strings"
"sync"