Fix race in DiskMountManager mount events
This CL fixes a race that can occur in the DiskMountManager when disks are added. Since we wait for the asynchronous GetDeviceProperties dbus call to complete before updating the disk map, if the disk mount event is received too soon, we notify observers of the mount even though the disk entry is not yet created. As a result, the CrosUsbDetector cannot correctly track these entries and settings may fail to prompt the user when trying to share USB drives. The notification that a new removable storage device is added also does not appear. We fix this by deferring sending the event until GetDeviceProperties returns. I observed this race being triggered consistently on an IronKey D300s drive, which initially presents itself as a CD drive. Bug: 1146325 Change-Id: I2a6b6c352b36c1e06a7ddaa49d5b987e7458c8b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2592575Reviewed-by:Joel Hockey <joelhockey@chromium.org> Commit-Queue: Timothy Loh <timloh@chromium.org> Cr-Commit-Position: refs/heads/master@{#837848}
Showing
Please register or sign in to comment