File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -210,11 +210,20 @@ func getMultipathDisk(path string) (string, error) {
210
210
// Fallback to iterating through all the entries under /sys/block/dm-* and
211
211
// check to see if any have an entry under /sys/block/dm-*/slaves matching
212
212
// the device the symlink was pointing at
213
+ attempts := 1
213
214
dmPaths , err := filepath .Glob ("/sys/block/dm-*" )
214
- debug .Printf ("-- dmPaths=%v" , dmPaths )
215
- if err != nil {
216
- debug .Printf ("Glob error: %s" , err )
217
- return "" , err
215
+ for attempts < 4 {
216
+ debug .Printf ("[%d] dmPaths=%v" , attempts , dmPaths )
217
+ if err != nil {
218
+ debug .Printf ("Glob error: %s" , err )
219
+ return "" , err
220
+ }
221
+ if len (dmPaths ) > 0 {
222
+ break
223
+ }
224
+ time .Sleep (1 * time .Second )
225
+ attempts ++
226
+ dmPaths , err = filepath .Glob ("/sys/block/dm-*" )
218
227
}
219
228
for _ , dmPath := range dmPaths {
220
229
sdevices , err := filepath .Glob (filepath .Join (dmPath , "slaves" , "*" ))
You can’t perform that action at this time.
0 commit comments