From 8915785acf7e6e7908b32103406620f243093931 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 19 Jul 2020 23:03:47 +0200 Subject: 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. --- mount.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mount.go') 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 -- cgit v1.2.3