Merge "Revert^5 "Set block device as RO/RW before mount"" into main am: 07f977220e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3335053 Change-Id: I0486e278c22c15d041e8b08c4683a8fb3725e24d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
99a59649ce
1 changed files with 3 additions and 3 deletions
|
|
@ -822,9 +822,6 @@ static int __mount(const std::string& source, const std::string& target, const F
|
||||||
if (read_only) {
|
if (read_only) {
|
||||||
mountflags |= MS_RDONLY;
|
mountflags |= MS_RDONLY;
|
||||||
}
|
}
|
||||||
if (!fs_mgr_set_blk_ro(source, read_only)) {
|
|
||||||
PLOG(ERROR) << "Failed to set " << source << " as " << (read_only ? "RO" : "RW");
|
|
||||||
}
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int save_errno = 0;
|
int save_errno = 0;
|
||||||
int gc_allowance = 0;
|
int gc_allowance = 0;
|
||||||
|
|
@ -879,6 +876,9 @@ static int __mount(const std::string& source, const std::string& target, const F
|
||||||
}
|
}
|
||||||
PINFO << __FUNCTION__ << "(source=" << source << source_missing << ",target=" << target
|
PINFO << __FUNCTION__ << "(source=" << source << source_missing << ",target=" << target
|
||||||
<< target_missing << ",type=" << entry.fs_type << ")=" << ret;
|
<< target_missing << ",type=" << entry.fs_type << ")=" << ret;
|
||||||
|
if ((ret == 0) && (mountflags & MS_RDONLY) != 0) {
|
||||||
|
fs_mgr_set_blk_ro(source);
|
||||||
|
}
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
android::base::SetProperty("ro.boottime.init.mount." + Basename(target),
|
android::base::SetProperty("ro.boottime.init.mount." + Basename(target),
|
||||||
std::to_string(t.duration().count()));
|
std::to_string(t.duration().count()));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue