udev + libbklid: synchronized uevent handling between kernel and ueventd?
Hi,
If I understand right, when kernel sends a KOBJ_CHANGE uevent, udevd catches it and update the ctime/mtime of the device file in /dev according to the uevent. Do I understand the procedure right?
Then a problem occurs to me that, the above procedure is asynchronized,
so sometimes concurreny may happen when kernel send the uevent but udev has
not yet updated the ctime/mtime of device file, making libblkid cache still valid and gives wrong result. (bringing the old thread again: http://www.spinics.net/lists/util-linux-ng/msg09154.html)
So i'm wondering is there some synchronized method to send uevent and wait for it completed? Currently I use a method that opens and updates ctime/mtime in kernel spaces, but it's somewhat ugly.
Hope there will be some elegent method.
Thanks,
Qu