diff --git a/pkg/volume/csi/csi_attacher.go b/pkg/volume/csi/csi_attacher.go index 7e1462d70ae..ae6a267c001 100644 --- a/pkg/volume/csi/csi_attacher.go +++ b/pkg/volume/csi/csi_attacher.go @@ -356,9 +356,8 @@ func (c *csiAttacher) MountDevice(spec *volume.Spec, devicePath string, deviceMo if err != nil { glog.Errorf(log("attacher.MountDevice failed: %v", err)) - if err := removeMountDir(c.plugin, deviceMountPath); err != nil { - glog.Error(log("attacher.MountDevice failed to remove mount dir after a NodeStageVolume() error [%s]: %v", deviceMountPath, err)) - return err + if removeMountDirErr := removeMountDir(c.plugin, deviceMountPath); removeMountDirErr != nil { + glog.Error(log("attacher.MountDevice failed to remove mount dir after a NodeStageVolume() error [%s]: %v", deviceMountPath, removeMountDirErr)) } return err } diff --git a/pkg/volume/csi/csi_mounter.go b/pkg/volume/csi/csi_mounter.go index 01b954a1a80..d9646d15eef 100644 --- a/pkg/volume/csi/csi_mounter.go +++ b/pkg/volume/csi/csi_mounter.go @@ -213,9 +213,8 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error { if err != nil { glog.Errorf(log("mounter.SetupAt failed: %v", err)) - if err := removeMountDir(c.plugin, dir); err != nil { - glog.Error(log("mounter.SetuAt failed to remove mount dir after a NodePublish() error [%s]: %v", dir, err)) - return err + if removeMountDirErr := removeMountDir(c.plugin, dir); removeMountDirErr != nil { + glog.Error(log("mounter.SetupAt failed to remove mount dir after a NodePublish() error [%s]: %v", dir, removeMountDirErr)) } return err }