Fix logic to figure out what /data fstab entry was mounted
Now the logic is handled by following API: GetMountedEntryForUserdata(Fstab* fstab). Behind the scenes it does the following: 1. Reads /proc/mounts and gets block device /data is actually mounted on. 2. In case of it's a dm-device, recursively goes into it's slaves until finds the underlying block device. 3. Optimistically assumes that corresponding block device is a symlink and tries to read it. 4. Reads all the entries corresponding to /data from fstab. 5. For each of them, optimistically tries to readlink block_device. 6. If it matches the resolved block devices, we found our fstab entry! Also added a test to CtsFsMgrTestCases asserting that /data was mounted from one of entries in default fstab. Test: on blueline & taimen, with & without checkpointing: Test: atest CtsFsMgrTestCases Test: adb reboot userspace Bug: 135984674 Change-Id: Ic70daeeb18096c7b134004334cc674dacc6e36f3
Loading
Please register or sign in to comment