aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-10-22 14:43:24 +0200
committerJakob Unterwurzacher2017-10-22 14:43:24 +0200
commit8c1b363f74f4db4e413fe17e327a82bd6ef66837 (patch)
treed6ec1e3d99239c44a91164306902c9a0601b5cc6
parenta1170be979cb75da11e84f45f67d3f5468d97669 (diff)
reverse mode: disable ClientInodes (hard link tracking)
Disable hard link tracking to avoid strange breakage on duplicate inode numbers ( https://github.com/rfjakob/gocryptfs/issues/149 ). Reverse mode is read-only, so we don't need a working link().
-rw-r--r--mount.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/mount.go b/mount.go
index 143747c..4f57381 100644
--- a/mount.go
+++ b/mount.go
@@ -221,10 +221,19 @@ func initFuseFrontend(masterkey []byte, args *argContainer, confFile *configfile
tlog.Debug.Printf("frontendArgs: %s", string(jsonBytes))
var finalFs pathfs.FileSystem
var ctlSockBackend ctlsock.Interface
+ // pathFsOpts are passed into go-fuse/pathfs
+ pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true}
if args.reverse {
+ // The dance with the intermediate variables is because we need to
+ // cast the FS into pathfs.FileSystem *and* ctlsock.Interface. This
+ // avoids using interface{}.
fs := fusefrontend_reverse.NewFS(masterkey, frontendArgs)
finalFs = fs
ctlSockBackend = fs
+ // Reverse mode is read-only, so we don't need a working link().
+ // Disable hard link tracking to avoid strange breakage on duplicate
+ // inode numbers ( https://github.com/rfjakob/gocryptfs/issues/149 ).
+ pathFsOpts.ClientInodes = false
} else {
fs := fusefrontend.NewFS(masterkey, frontendArgs)
finalFs = fs
@@ -240,7 +249,6 @@ func initFuseFrontend(masterkey []byte, args *argContainer, confFile *configfile
if args._ctlsockFd != nil {
go ctlsock.Serve(args._ctlsockFd, ctlSockBackend)
}
- pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true}
pathFs := pathfs.NewPathNodeFs(finalFs, pathFsOpts)
fuseOpts := &nodefs.Options{
// These options are to be compatible with libfuse defaults,