From b21f227bd3b3c80bdffc2c7da52063101f2a9863 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 18 Nov 2017 17:49:09 +0000 Subject: [PATCH] mounttest: fix crash when FUSE not present --- cmd/mountlib/mounttest/fs.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/mountlib/mounttest/fs.go b/cmd/mountlib/mounttest/fs.go index dd79410d4..cf6489e65 100644 --- a/cmd/mountlib/mounttest/fs.go +++ b/cmd/mountlib/mounttest/fs.go @@ -131,10 +131,11 @@ func (r *Run) mount() { var err error r.vfs, r.umountResult, r.umountFn, err = mountFn(r.fremote, r.mountPath) if err != nil { - log.Printf("mount failed: %v", err) + log.Printf("mount FAILED: %v", err) r.skip = true + } else { + log.Printf("mount OK") } - log.Printf("mount OK") } func (r *Run) umount() { @@ -174,6 +175,10 @@ func (r *Run) umount() { // cacheMode flushes the VFS and changes the CacheMode func (r *Run) cacheMode(cacheMode vfs.CacheMode) { + if r.skip { + log.Printf("FUSE not found so skipping cacheMode") + return + } // Wait for writers to finish r.vfs.WaitForWriters(30 * time.Second) // Empty and remake the remote