From 8657a139158f46a0deddd8e89ec62aac4c46a57b Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Thu, 26 Oct 2023 12:17:57 -0700 Subject: [PATCH] pkg/mount: fix dropped error Signed-off-by: Lars Lehtonen --- pkg/mount/mount.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index da052e98a..979c94157 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -18,12 +18,12 @@ import ( "syscall" "time" - "github.com/moby/sys/mountinfo" "github.com/libopenstorage/openstorage/pkg/chattr" "github.com/libopenstorage/openstorage/pkg/keylock" "github.com/libopenstorage/openstorage/pkg/options" "github.com/libopenstorage/openstorage/pkg/sched" "github.com/libopenstorage/openstorage/volume" + "github.com/moby/sys/mountinfo" "github.com/pborman/uuid" "github.com/sirupsen/logrus" ) @@ -669,6 +669,10 @@ func (m *Mounter) removeMountPath(path string) error { } if devicePath, mounted := bindMounter.HasTarget(path); mounted { bindMountPath, err = bindMounter.GetRootPath(path) + if err != nil { + logrus.Warnf("Failed to get root path for %q. Err: %v", path, err) + return err + } if err := m.mountImpl.Unmount(path, 0, 0); err != nil { return fmt.Errorf("failed to unmount bind mount %v. Err: %v", devicePath, err) }