Avoid deadlock between udev probing stage2 image and stage1 mounting it #1

Merged
asheplyakov merged 2 commits from fix-40687 into master 2021-08-31 15:24:04 +03:00
Owner

LOOP_SET_FD, LOOP_SET_STATUS ioctls trigger a change event with loopback device in question. udev handles those events with (builtin) blkid command. Probing a device with blkid takes a while, so init might try to mount the loopback device in question while blkid is still running. As a result init and udev block each other. Eventually (after 3 minutes or whatever udev event timeout is) blkid gets killed and boot proceeds.

However such long delays are very annoying. Therefore run udev_settle after each loop related ioctl to avoid the concurrent access to the same loopback device.

Closes: #40687

LOOP_SET_FD, LOOP_SET_STATUS ioctls trigger a `change` event with loopback device in question. udev handles those events with (builtin) blkid command. Probing a device with blkid takes a while, so init might try to mount the loopback device in question while `blkid` is still running. As a result init and udev block each other. Eventually (after 3 minutes or whatever udev event timeout is) `blkid` gets killed and boot proceeds. However such long delays are very annoying. Therefore run `udev_settle` after each loop related ioctl to avoid the concurrent access to the same loopback device. Closes: #40687
First-time contributor

LGTM, +1

LGTM, +1
asheplyakov merged commit 0866902d10 into master 2021-08-31 15:24:04 +03:00
asheplyakov deleted branch fix-40687 2021-08-31 15:24:09 +03:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: asheplyakov/propagator#1
No description provided.