aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver
diff options
context:
space:
mode:
authorViktor Kuzmin <kvaster@gmail.com>2022-04-02 16:22:35 +0300
committerViktor Kuzmin <kvaster@gmail.com>2022-04-02 16:22:35 +0300
commitabe92bac90030a0120f7f6cc5d90aaffcf52e4f4 (patch)
tree53158e42a4c093f39a7f89b872dda4ee60da1054 /pkg/driver
parent498a0af0ee54b2c06dd0710cf6fd84722ea75912 (diff)
downloadseaweedfs-csi-driver-abe92bac90030a0120f7f6cc5d90aaffcf52e4f4.tar.xz
seaweedfs-csi-driver-abe92bac90030a0120f7f6cc5d90aaffcf52e4f4.zip
Do not fail if path is already unmounted
Diffstat (limited to 'pkg/driver')
-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..9d4aff3 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, _ := m.IsLikelyNotMountPoint(path); !ok {
+ 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 {