This fix re-introduces a wait loop when reading sysfs attributes.
The reason a wait is necessary is due to the way the kernel
sends the event. When a SCSI device is added the SCSI subsystem
pursues this path:
done with device_add, and now the kernel adds the attributes:
scsi_sysfs_sdev_attrs[i].vendor, model, rev
There are four uevents sent from the kernel in the creation of
a SysFS representation of the device. After the last event, the
SysFs entries for vendor,model, rev are populated. The window
time between the uevent with /block/sdX sent and the sysfs
attributes being populated is small. But it is possible (with
a slow serial link, slow SCSI target), to get us in a race
condition where multipath investigates the new block device and
finds it can't read the vendor, and the block device ends up
being discarded and never added to the device mapper multipath map.
---
libmultipath/discovery.c | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)