Skip to content

Commit 1ba7852

Browse files
NymanRobindd-georgiev
authored andcommitted
[cinder-csi-plugin] retry mount operation with rescan (#2610)
If the initial formatting and mounting fails in NodeStageVolume try to rescan the device and retry the operation. This prevents failures if the device information is reported wrongly which would otherwise be blocking the mounting. Signed-off-by: NymanRobin <[email protected]>
1 parent 5ca04df commit 1ba7852

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/util/blockdevice/blockdevice_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ func RescanBlockDeviceGeometry(devicePath string, deviceMountPath string, newSiz
128128
func RescanDevice(devicePath string) error {
129129
blockDeviceRescanPath, err := findBlockDeviceRescanPath(devicePath)
130130
if err != nil {
131-
return fmt.Errorf("Device does not have rescan path %s", devicePath)
131+
return fmt.Errorf("Device does not have rescan path " + devicePath)
132132
}
133133

134134
klog.V(3).Infof("Resolved block device path from %q to %q", devicePath, blockDeviceRescanPath)
135135
err = triggerRescan(blockDeviceRescanPath)
136136
if err != nil {
137-
return fmt.Errorf("Error rescanning new block device geometry %s", devicePath)
137+
return fmt.Errorf("Error rescanning new block device geometry " + devicePath)
138138
}
139139
return nil
140140
}

0 commit comments

Comments
 (0)