Remove unneeded 'slave' flag for /data_mirror/data_ce/null
Remove the 'slave' mount flag that was added by commit ef9275223c
(https://r.android.com/2095463) because it doesn't actually do anything
in this context. MS_SLAVE can only be used to change the propagation
type of an existing mount, and the kernel ignores it if MS_BIND is also
specified, due to the way the various high-level operations that the
mount() system call can do are prioritized.
The reason that the /data/user/0 mount gets propagated into /data_mirror
anyway is because the /data mount has the "shared" propagation type. In
the above-mentioned commit I had assumed the default Linux mount
semantics, but actually Android applies the "shared" propagation type to
everything (see SetupMountNamespaces() in init/mount_namespace.cpp).
Test: Booted Cuttlefish and verified (via /proc/self/mountinfo) that
/data/data is still bind-mounted to both /data/user/0 and
/data_mirror/data_ce/null/0.
Bug: 156305599
BYPASS_INCLUSIVE_LANGUAGE_REASON=commit message mentioning removed code
Change-Id: Idc45d8dcb3a21d4e8e2e72f4d4dda7286f898127
This commit is contained in:
parent
5e524e28ee
commit
28a1969ebf
1 changed files with 4 additions and 3 deletions
|
|
@ -952,9 +952,10 @@ on post-fs-data
|
|||
mkdir /data_mirror/data_de/null 0700 root root
|
||||
|
||||
# Bind mount CE and DE data directory to mirror's default volume directory.
|
||||
# The 'slave' option (MS_SLAVE) is needed to cause the later bind mount of
|
||||
# /data/data onto /data/user/0 to propagate to /data_mirror/data_ce/null/0.
|
||||
mount none /data/user /data_mirror/data_ce/null bind rec slave
|
||||
# Note that because the /data mount has the "shared" propagation type, the
|
||||
# later bind mount of /data/data onto /data/user/0 will automatically
|
||||
# propagate to /data_mirror/data_ce/null/0 as well.
|
||||
mount none /data/user /data_mirror/data_ce/null bind rec
|
||||
mount none /data/user_de /data_mirror/data_de/null bind rec
|
||||
|
||||
# Create mirror directory for jit profiles
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue