summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/root_node.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-03-07 17:22:29 +0100
committerJakob Unterwurzacher2021-03-07 17:22:29 +0100
commite2dc52a9657e530820b2d5b49ad7425b529029ce (patch)
tree75683d1194615dc2774a1b0f99850b798ade2b83 /internal/fusefrontend/root_node.go
parenteaca820e876bfcdc67323eac6dd43ecc420968f2 (diff)
v2api: -sharestorage: disable hard link tracking & add tests
Hard link tracking was not correctly disabled since the migration to the go-fuse v2 api. Add a test to ensure it stays off. Fixes https://github.com/rfjakob/gocryptfs/issues/525
Diffstat (limited to 'internal/fusefrontend/root_node.go')
-rw-r--r--internal/fusefrontend/root_node.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go
index e03e250..bdefafa 100644
--- a/internal/fusefrontend/root_node.go
+++ b/internal/fusefrontend/root_node.go
@@ -50,7 +50,7 @@ type RootNode struct {
IsIdle uint32
// inoMap translates inode numbers from different devices to unique inode
// numbers.
- inoMap *inomap.InoMap
+ inoMap inomap.TranslateStater
}
func NewRootNode(args Args, c *contentenc.ContentEnc, n nametransform.NameTransformer) *RootNode {
@@ -60,12 +60,18 @@ func NewRootNode(args Args, c *contentenc.ContentEnc, n nametransform.NameTransf
if len(args.Exclude) > 0 {
tlog.Warn.Printf("Forward mode does not support -exclude")
}
- return &RootNode{
+ rn := &RootNode{
args: args,
nameTransform: n,
contentEnc: c,
inoMap: inomap.New(),
}
+ // In `-sharedstorage` mode we always set the inode number to zero.
+ // This makes go-fuse generate a new inode number for each lookup.
+ if args.SharedStorage {
+ rn.inoMap = &inomap.TranslateStatZero{}
+ }
+ return rn
}
// mangleOpenFlags is used by Create() and Open() to convert the open flags the user