diff options
| author | chrislu <chris.lu@gmail.com> | 2022-04-03 01:07:11 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-04-03 01:07:11 -0700 |
| commit | 909a9ce4fac5a04a4de4ee1f83c556dd90d8f1bc (patch) | |
| tree | 71309cb1fff29a3cb39d96582b2c37dd059cf146 | |
| parent | e1dcd15f015e5dadd123982b8f6d51f1f3b99c26 (diff) | |
| parent | bf8fbaf3ac6a036c25a56266f8a82ac785d61e9e (diff) | |
| download | seaweedfs-csi-driver-909a9ce4fac5a04a4de4ee1f83c556dd90d8f1bc.tar.xz seaweedfs-csi-driver-909a9ce4fac5a04a4de4ee1f83c556dd90d8f1bc.zip | |
Merge branch 'master' of https://github.com/seaweedfs/seaweedfs-csi-driver
| -rw-r--r-- | pkg/driver/mounter.go | 9 |
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 { |
