summaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-07-19 23:03:47 +0200
committerJakob Unterwurzacher2020-07-19 23:03:47 +0200
commit8915785acf7e6e7908b32103406620f243093931 (patch)
tree94b7e6f1636f4d3355f8c13723125fc40a45f562 /mount.go
parent49fc3abcb4867ea4ce2426340dbe583ef6de055a (diff)
v2api: fsck: use a temporary mount
Directly accessing the Nodes does not work properly, as there is no way to attach a newly LOOKUPped Node to the tree. This means Path() does not work. Use an actual mount instead and walk the tree.
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/mount.go b/mount.go
index 693d0c0..e8fa720 100644
--- a/mount.go
+++ b/mount.go
@@ -221,7 +221,7 @@ func setOpenFileLimit() {
}
}
-// initFuseFrontend - initialize gocryptfs/fusefrontend
+// initFuseFrontend - initialize gocryptfs/internal/fusefrontend
// Calls os.Exit on errors
func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys func()) {
var err error
@@ -326,6 +326,9 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f
return rootNode, func() { cCore.Wipe() }
}
+// initGoFuse calls into go-fuse to mount `rootNode` on `args.mountpoint`.
+// The mountpoint is ready to use when the functions returns.
+// On error, it calls os.Exit and does not return.
func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
var fuseOpts *fs.Options
sec := time.Second