This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device: fix the issue of failed waiting on device appeared in /dev
There is an issue with the waitForDevice: this wait will first check is the device's sys entry existed in /sys directory, and if it existed, then it would return directly. How ever, the kernel register a new device as an order of: 1) create the sys entry in /sys; 2) mknod in devtmpfs; 3) send uevent to userspace. The problem here is when the "wait" tested the sys entry existed and return directly, but at that time the kernel would haven't created the device node in devtmpfs, thus the following mount failed with couldn't resolve the device path. Thus, the correct choice for waiting the device is depends on the uevent notice, since once the kernel sended the device "add" uevent, it had created the device node in devtmpfs yet. Fixes: #628 Signed-off-by: lifupan <[email protected]>
- Loading branch information
Showing
5 changed files
with
121 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.