Skip to content

Commit 81295cd

Browse files
committed
multirom: Fix /data/media/0 media linkage for SDCardFS
* In a MultiROM environment, /data is owned by the booted secondary ROM, specifically it can even be part of an external MicroSD (for example with EXT4) * By using a ROM supporting SDCardFS, the interal media storage will be accessed through its driver, but the fact /data/media/0 could be used under specific conditions means the /data/media mounts used by the emulated storage loop through: - /data/media (external ROM) - /data/media/0 (internal storage) * SDCardFS prevents "cross-device" linkage by returning -EXDEV, breaking internal storage access * Always use the proper /data/media path on newer APIs to avoid any cross-device linkage of internal storage Change-Id: Ib49db68eede289d3943b9537d542eef5082e3118 Signed-off-by: Adrian DC <[email protected]>
1 parent e4acabe commit 81295cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

multirom.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,8 +1774,7 @@ int multirom_create_media_link(struct multirom_status *s)
17741774
else if(api_level >= 17)
17751775
{
17761776
from = 0;
1777-
if(!media_new) to = 3;
1778-
else to = 2;
1777+
to = 2;
17791778
}
17801779

17811780
ERROR("Making media dir: api %d, media_new %d, %s to %s\n", api_level, media_new, paths[from], paths[to]);

0 commit comments

Comments
 (0)