mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Using "chzdev -e" to configurate a device persistently, the corresponding udev rule is also created, which will trigger a uevent that sets the device online as soon as the group device is created. If 'znetconf -r/R' is first used to remove such a configured device (which won't remove the corresponding udev rule) and then 'znetconf -a/A' afterwards on the same device, either the error "Failed to make <device> online" or "Failed to configure layer2=1" will occur. For the first error, the udev queue might not have been fully processed and hence the check whether a device is online may fail due to that race. Call 'udevadm settle' to ensure a fully processed queue before checking whether a device is online. The second error occurs, because configure_ccwgroupdev_option() does not check whether the device is online. Add the check and set the device offline if necessary. Also, log any details for debugging purposes. Signed-off-by: Wenjia Zhang <wenjia@linux.ibm.com> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>