Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83341a11 authored by Arve Hjønnevåg's avatar Arve Hjønnevåg
Browse files

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
parent 2629c6c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment