From 2f8931315a570a7183d18db6578af6803fd36783 Mon Sep 17 00:00:00 2001 From: gman Date: Tue, 26 Feb 2019 14:46:21 +0100 Subject: [PATCH] don't attempt to delete mountpoint if unmount failed --- pkg/cephfs/volume.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cephfs/volume.go b/pkg/cephfs/volume.go index 3103aa74e..7b8dea03a 100644 --- a/pkg/cephfs/volume.go +++ b/pkg/cephfs/volume.go @@ -149,9 +149,9 @@ func unmountCephRoot(volID volumeID) { if err := unmountVolume(cephRoot); err != nil { klog.Errorf("failed to unmount %s with error %s", cephRoot, err) - } - - if err := os.Remove(cephRoot); err != nil { - klog.Errorf("failed to remove %s with error %s", cephRoot, err) + } else { + if err := os.Remove(cephRoot); err != nil { + klog.Errorf("failed to remove %s with error %s", cephRoot, err) + } } }