Merge "Use the dm target for userdata" into main am: 389c03d4c8

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2835040

Change-Id: Id6f83b214d10bc1e02281198eff3924990641af2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jaegeuk Kim 2023-11-17 20:55:17 +00:00 committed by Automerger Merge Worker
commit 426361dc7c

View file

@ -828,7 +828,14 @@ static int __mount(const std::string& source, const std::string& target, const F
<< ",type=" << entry.fs_type << ", gc_allowance=" << gc_allowance << "%)=" << ret
<< "(" << save_errno << ")";
}
ret = mount(source.c_str(), target.c_str(), entry.fs_type.c_str(), mountflags,
// Let's get the raw dm target, if it's a symlink, since some existing applications
// rely on /proc/mounts to find the userdata's dm target path. Don't break that assumption.
std::string real_source;
if (!android::base::Realpath(source, &real_source)) {
real_source = source;
}
ret = mount(real_source.c_str(), target.c_str(), entry.fs_type.c_str(), mountflags,
opts.c_str());
save_errno = errno;
if (try_f2fs_gc_allowance) gc_allowance += 10;