diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2022-04-02 11:13:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-02 11:13:50 -0700 |
| commit | 937a0dc33f212e86adc096188a72262b398deda8 (patch) | |
| tree | 53158e42a4c093f39a7f89b872dda4ee60da1054 /pkg | |
| parent | 498a0af0ee54b2c06dd0710cf6fd84722ea75912 (diff) | |
| parent | abe92bac90030a0120f7f6cc5d90aaffcf52e4f4 (diff) | |
| download | seaweedfs-csi-driver-937a0dc33f212e86adc096188a72262b398deda8.tar.xz seaweedfs-csi-driver-937a0dc33f212e86adc096188a72262b398deda8.zip | |
Merge pull request #53 from kvaster/unmount-fix
Do not fail if path is already unmounted
Diffstat (limited to 'pkg')
| -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..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 { |
