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().
This commit is contained in:
parent
a1170be979
commit
8c1b363f74
10
mount.go
10
mount.go
|
@ -221,10 +221,19 @@ func initFuseFrontend(masterkey []byte, args *argContainer, confFile *configfile
|
||||||
tlog.Debug.Printf("frontendArgs: %s", string(jsonBytes))
|
tlog.Debug.Printf("frontendArgs: %s", string(jsonBytes))
|
||||||
var finalFs pathfs.FileSystem
|
var finalFs pathfs.FileSystem
|
||||||
var ctlSockBackend ctlsock.Interface
|
var ctlSockBackend ctlsock.Interface
|
||||||
|
// pathFsOpts are passed into go-fuse/pathfs
|
||||||
|
pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true}
|
||||||
if args.reverse {
|
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)
|
fs := fusefrontend_reverse.NewFS(masterkey, frontendArgs)
|
||||||
finalFs = fs
|
finalFs = fs
|
||||||
ctlSockBackend = 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 {
|
} else {
|
||||||
fs := fusefrontend.NewFS(masterkey, frontendArgs)
|
fs := fusefrontend.NewFS(masterkey, frontendArgs)
|
||||||
finalFs = fs
|
finalFs = fs
|
||||||
|
@ -240,7 +249,6 @@ func initFuseFrontend(masterkey []byte, args *argContainer, confFile *configfile
|
||||||
if args._ctlsockFd != nil {
|
if args._ctlsockFd != nil {
|
||||||
go ctlsock.Serve(args._ctlsockFd, ctlSockBackend)
|
go ctlsock.Serve(args._ctlsockFd, ctlSockBackend)
|
||||||
}
|
}
|
||||||
pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true}
|
|
||||||
pathFs := pathfs.NewPathNodeFs(finalFs, pathFsOpts)
|
pathFs := pathfs.NewPathNodeFs(finalFs, pathFsOpts)
|
||||||
fuseOpts := &nodefs.Options{
|
fuseOpts := &nodefs.Options{
|
||||||
// These options are to be compatible with libfuse defaults,
|
// These options are to be compatible with libfuse defaults,
|
||||||
|
|
Loading…
Reference in New Issue