diff options
author | Daniel Drake <drake@endlessm.com> | 2015-04-06 16:03:43 -0600 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-04-12 13:18:48 -0400 |
commit | cdbef8fd5a933de71c57cb1b4e337f1616f4a034 (patch) | |
tree | 9464fa3a79128c5c44a683af0c4ce5cb18dd24f1 /hwdb | |
parent | 1cd8de00b544c4f2ad97156c6c523209934bda9a (diff) |
udevd: fix synchronization with settle when handling inotify events
udev uses inotify to implement a scheme where when the user closes
a writable device node, a change uevent is forcefully generated.
In the case of block devices, it actually requests a partition rescan.
This currently can't be synchronized with "udevadm settle", i.e. this
is not reliable in a script:
sfdisk --change-id /dev/sda 1 81
udevadm settle
mount /dev/sda1 /foo
The settle call doesn't synchronize there, so at the same time we try
to mount the device, udevd is busy removing the partition device nodes and
readding them again. The mount call often happens in that moment where the
partition node has been removed but not readded yet.
This exact issue was fixed long ago:
http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=bb38678e3ccc02bcd970ccde3d8166a40edf92d3
but that fix is no longer valid now that sequence numbers are no longer
used.
Fix this by forcing another mainloop iteration after handling inotify events
before unblocking settle. If the inotify event caused us to generate a
"change" event, we'll pick that up in the following loop iteration, before
we reach the end of the loop where we respond to settle's control message,
unblocking it.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'hwdb')
0 files changed, 0 insertions, 0 deletions