Systemd/udev/lib
Scott James Remnant bb38678e3c udevadm: settle - synchronise with the udev daemon
There's still a slight race condition when using udevadm settle, if the
udev daemon has a pending inotify event but hasn't yet generated the
"change" uevent for it, the kernel and udev sequence numbers will match
and settle will exit.

Now udevadm settle will send a control message to udevd, which will
respond by sending SIGUSR1 back to the waiting udevadm settle once it
has completed the main loop iteration in which it received the control
message.

If there were no pending inotify events, this will simply wake up the
udev daemon and allow settle to continue.  If there are pending inotify
events, they are handled first in the main loop so when settle is
continued they will have been turned into uevents and the kernel
sequence number will have been incremented.

Since the inotify event is pending for udevd when the close() system
call returns (it's queued as part of the kernel handling for that system
call), and since the kernel sequence number is incremented by writing to
the uevent file (as udevd does), this solves the race.

When the settle continues, if there were pending inotify events that
udevd had not read, they are now pending uevents which settle can wait
for.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-03-12 10:02:37 +00:00
..
.gitignore
exported_symbols libudev: test - add udev_device_get_property_value() 2009-01-06 16:52:40 +01:00
libudev-ctrl.c udevadm: settle - synchronise with the udev daemon 2009-03-12 10:02:37 +00:00
libudev-device-db-write.c Allow watch handle to be stored in the udevdb. 2009-02-23 17:31:26 +00:00
libudev-device.c Allow watch handle to be stored in the udevdb. 2009-02-23 17:31:26 +00:00
libudev-enumerate.c libudev: enumerate - add lookup by property 2008-12-29 07:42:19 +01:00
libudev-list.c fix list handling in enumerate and rules file sorting 2008-11-04 20:19:01 +01:00
libudev-monitor.c libudev: device - add devtype support 2009-01-02 04:37:04 +01:00
libudev-private.h udevadm: settle - synchronise with the udev daemon 2009-03-12 10:02:37 +00:00
libudev-queue.c libudev: queue - use lstat() to check existence of symlink 2009-03-04 23:32:16 +01:00
libudev-util.c libudev: accept NULL whitelist in util_replace_chars() 2008-11-20 02:43:34 +01:00
libudev.c fix list handling in enumerate and rules file sorting 2008-11-04 20:19:01 +01:00
libudev.h libudev: device - add udev_device_get_property_value() 2009-01-06 00:26:28 +01:00
libudev.pc.in
Makefile.am
test-libudev.c libudev: test - add udev_device_get_property_value() 2009-01-06 16:52:40 +01:00