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) + } } }