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) {
210210 // Fallback to iterating through all the entries under /sys/block/dm-* and
211211 // check to see if any have an entry under /sys/block/dm-*/slaves matching
212212 // the device the symlink was pointing at
213+ attempts := 1
213214 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-*" )
218227 }
219228 for _ , dmPath := range dmPaths {
220229 sdevices , err := filepath .Glob (filepath .Join (dmPath , "slaves" , "*" ))
You can’t perform that action at this time.
0 commit comments