aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/driver/mounter.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/driver/mounter.go b/pkg/driver/mounter.go
index 82da5f6..e0a6283 100644
--- a/pkg/driver/mounter.go
+++ b/pkg/driver/mounter.go
@@ -38,9 +38,14 @@ func fuseMount(path string, command string, args []string) error {
}
func fuseUnmount(path string) error {
- if err := mount.New("").Unmount(path); err != nil {
- return err
+ m := mount.New("")
+
+ if ok, err := m.IsLikelyNotMountPoint(path); !ok || mount.IsCorruptedMnt(err) {
+ if err := m.Unmount(path); err != nil {
+ return err
+ }
}
+
// as fuse quits immediately, we will try to wait until the process is done
process, err := findFuseMountProcess(path)
if err != nil {