From d1f3107778926f27bcb26297e353ccd7efb4a8e9 Mon Sep 17 00:00:00 2001 From: MingZhang-YBPS <74715700+MingZhang-YBPS@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:37:16 +0800 Subject: [PATCH] Update mounter.go --- pkg/mounter/mounter.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/mounter/mounter.go b/pkg/mounter/mounter.go index d190f20..9d78799 100644 --- a/pkg/mounter/mounter.go +++ b/pkg/mounter/mounter.go @@ -73,7 +73,13 @@ func fuseMount(path string, command string, args []string, envs []string) error } func Unmount(path string) error { - if err := mount.New("").Unmount(path); err != nil { + mounter := mount.New("") + isNotMountPoint, err := mounter.IsNotMountPoint(path) + if isNotMountPoint || err != nil { + glog.Warningf("Skip Unmount since path (%s) may not a valid mount point: %v", path, err) + return nil + } + if err := mounter.Unmount(path); err != nil { return err } return nil