Revert^4 "Set block device as RO/RW before mount"
This reverts commit 1df3536b955fd4c0ee4c7b760beea29c1a1bdec5.
Previous land got reverted because of selinux denial, which is
already taken care of in aosp/3314877
Reason for revert: b/349507086
Change-Id: Id642b4d8726c72f324e369d8506c78eacea331e3
diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp
index 5156754..ea2e3a8 100644
--- a/fs_mgr/fs_mgr.cpp
+++ b/fs_mgr/fs_mgr.cpp
@@ -826,6 +826,9 @@
if (read_only) {
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 save_errno = 0;
int gc_allowance = 0;
@@ -880,9 +883,6 @@
}
PINFO << __FUNCTION__ << "(source=" << source << source_missing << ",target=" << target
<< target_missing << ",type=" << entry.fs_type << ")=" << ret;
- if ((ret == 0) && (mountflags & MS_RDONLY) != 0) {
- fs_mgr_set_blk_ro(source);
- }
if (ret == 0) {
android::base::SetProperty("ro.boottime.init.mount." + Basename(target),
std::to_string(t.duration().count()));