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

Skip to content
Commit b0e6c82a authored by Yi-Yo Chiang's avatar Yi-Yo Chiang Committed by Yi-yo Chiang
Browse files

overlayfs: Mount overlay with context= fs_options if original mount has it

Say we have mount configurations as follows:
  mount <dev> /mnt_point -t ext4 -o ro,context=<se_file_context>
  mount overlay /mnt_point2 -t overlay -o lowerdir=/mnt_point,upperdir=...

Overlayfs driver doesn't forward the overridden file context from
/mnt_point to /mnt_point2, thus the same file (same inode) would have
different file context when accessed via /mnt_point and /mnt_point2.

This change makes adb remount to mount filesystem overlays with context=
option if the overlaid mountpoint has it too. This makes the files under
context= mountpoint to retain the same file context after remount.

Also run clang-format on the whole file to fix some formatting issues.

Bug: 243501054
Test: adb remount && check file context with "ls -Z"
Change-Id: Ie4815604c56f1ce81b755cd0569b6577bd5f575f
parent e0877535
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment