storageproxyd: Call open_possibly_mapped_file on all open paths
Remove the direct open paths from storage_file_open and always call open_possibly_mapped_file instead. This fixes two bugs. If /data became available between trying to open the symlink and checking the root path, the open would succeed on the backing_storage but storage_file_write would fail because the it would try to create the symlink again. If storageproxyd restarts when the symlink does not exist, but the storage_server thinks the file it opened with STORAGE_FILE_OPEN_CREATE before the restart should still exist, it might try to re-open it without STORAGE_FILE_OPEN_CREATE. This would fail because storage_file_open would not call open_possibly_mapped_file unless STORAGE_FILE_OPEN_CREATE was passed. Test: --test com.android.storage-unittest.td-init-check-clean Change-Id: I2e32340f09381465a82812ad8963a9e76ea997e7
Loading
Please register or sign in to comment