v2api: enable go-fuse warnings on mount & fsck
This commit is contained in:
parent
751f237993
commit
015a884090
7
fsck.go
7
fsck.go
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -254,7 +255,11 @@ func fsck(args *argContainer) {
|
|||||||
}
|
}
|
||||||
args.allow_other = false
|
args.allow_other = false
|
||||||
pfs, wipeKeys := initFuseFrontend(args)
|
pfs, wipeKeys := initFuseFrontend(args)
|
||||||
fs.NewNodeFS(pfs, &fs.Options{})
|
opts := fs.Options{
|
||||||
|
// Enable go-fuse warnings
|
||||||
|
Logger: log.New(os.Stderr, "go-fuse: ", 0),
|
||||||
|
}
|
||||||
|
fs.NewNodeFS(pfs, &opts)
|
||||||
rn := pfs.(*fusefrontend.RootNode)
|
rn := pfs.(*fusefrontend.RootNode)
|
||||||
rn.MitigatedCorruptions = make(chan string)
|
rn.MitigatedCorruptions = make(chan string)
|
||||||
ck := fsckObj{
|
ck := fsckObj{
|
||||||
|
18
mount.go
18
mount.go
@ -24,7 +24,6 @@ import (
|
|||||||
|
|
||||||
"github.com/hanwen/go-fuse/v2/fs"
|
"github.com/hanwen/go-fuse/v2/fs"
|
||||||
"github.com/hanwen/go-fuse/v2/fuse"
|
"github.com/hanwen/go-fuse/v2/fuse"
|
||||||
"github.com/hanwen/go-fuse/v2/fuse/pathfs"
|
|
||||||
|
|
||||||
"github.com/rfjakob/gocryptfs/internal/configfile"
|
"github.com/rfjakob/gocryptfs/internal/configfile"
|
||||||
"github.com/rfjakob/gocryptfs/internal/contentenc"
|
"github.com/rfjakob/gocryptfs/internal/contentenc"
|
||||||
@ -328,20 +327,6 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
|
func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
|
||||||
// pathFsOpts are passed into go-fuse/pathfs
|
|
||||||
pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true}
|
|
||||||
if args.sharedstorage {
|
|
||||||
// shared storage mode disables hard link tracking as the backing inode
|
|
||||||
// numbers may change behind our back:
|
|
||||||
// https://github.com/rfjakob/gocryptfs/issues/156
|
|
||||||
pathFsOpts.ClientInodes = false
|
|
||||||
}
|
|
||||||
if args.reverse {
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
var fuseOpts *fs.Options
|
var fuseOpts *fs.Options
|
||||||
sec := time.Second
|
sec := time.Second
|
||||||
if args.sharedstorage {
|
if args.sharedstorage {
|
||||||
@ -358,6 +343,8 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fuseOpts.NullPermissions = true
|
fuseOpts.NullPermissions = true
|
||||||
|
// Enable go-fuse warnings
|
||||||
|
fuseOpts.Logger = log.New(os.Stderr, "go-fuse: ", 0)
|
||||||
fuseOpts.MountOptions = fuse.MountOptions{
|
fuseOpts.MountOptions = fuse.MountOptions{
|
||||||
// Writes and reads are usually capped at 128kiB on Linux through
|
// Writes and reads are usually capped at 128kiB on Linux through
|
||||||
// the FUSE_MAX_PAGES_PER_REQ kernel constant in fuse_i.h. Our
|
// the FUSE_MAX_PAGES_PER_REQ kernel constant in fuse_i.h. Our
|
||||||
@ -368,6 +355,7 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
|
|||||||
MaxWrite: fuse.MAX_KERNEL_WRITE,
|
MaxWrite: fuse.MAX_KERNEL_WRITE,
|
||||||
Options: []string{fmt.Sprintf("max_read=%d", fuse.MAX_KERNEL_WRITE)},
|
Options: []string{fmt.Sprintf("max_read=%d", fuse.MAX_KERNEL_WRITE)},
|
||||||
}
|
}
|
||||||
|
|
||||||
mOpts := &fuseOpts.MountOptions
|
mOpts := &fuseOpts.MountOptions
|
||||||
if args.allow_other {
|
if args.allow_other {
|
||||||
tlog.Info.Printf(tlog.ColorYellow + "The option \"-allow_other\" is set. Make sure the file " +
|
tlog.Info.Printf(tlog.ColorYellow + "The option \"-allow_other\" is set. Make sure the file " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user