summaryrefslogtreecommitdiff
path: root/base/errors_unix.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-06-16 16:48:47 -0700
committerTom Cherry <tomcherry@google.com>2017-06-20 14:26:15 -0700
commitf51657ccef9d49b3dc037aae5a072bce795fcf99 (patch)
tree7821b5009d8bbe762b439131f4baf5ee6f525e05 /base/errors_unix.cpp
parent56876ad5186fc7fec3c536730c2f70c33ebae3c4 (diff)
ueventd: remove PlatformDeviceList
In order to create symlinks for USB and block devices, the path for their parent platform device must be known. Previously, ueventd would save each platform device that it encounters to a list and query this list when creating the symlinks. That, however, is racy because the uevent socket does not differentiate uevents from RegenerateUevents() and uevents sent by the kernel when probing a device first the first time. The below scenario is the faulty case: 1) Kernel probes parent platform device for a block device 2) ueventd calls RegenerateUevents() and starts processing uevents 3) Kernel probes block device and sends its uevents 4) ueventd picks up the block device uevent during its uevent processing, without yet regenerating the platform device uevent, causing improper symlinks to be created. This change stops storing the platform devices in a list, and instead traverses up the directory structure for each USB or block device until it reaches a platform device, defined as one whose subsystem is the platform bus. This fixes the race and simplifies the ueventd code. Bug: 62436493 Bug: 62681642 Test: Boot bullhead Test: Boot sailfish Test: Init unit tests Test: Boot hikey + hotplug/unplug sdcard Merged-In: I21636355d8e434f30e0cba568598a6cf139e67f9 Change-Id: I21636355d8e434f30e0cba568598a6cf139e67f9 (cherry picked from commit c94ce7b130979317d9523ba0d175f0ad369fb1c4)
Diffstat (limited to 'base/errors_unix.cpp')
0 files changed, 0 insertions, 0 deletions