android_system_core/set-verity-state
Yi-Yo Chiang 258f0237c9 set-verity-state: Harden logic of overlayfs setup/teardown
Refactor set_avb_verity_state() to return tri-state result:
  {.success=false}
    Failed to set verity state.
  {.success=true, .want_reboot=false}
    Success but verity already is requested state, so no need to reboot.
  {.success=true, .want_reboot=true}
    Successfully changed verity state, need reboot to take effect.

Setup overlayfs only if verity is going to be or already disabled.
Teardown overlayfs regardless of enable-verity success of not.
This ensures more robust behavior of setup / teardown overlayfs.

Adjust the log messages for consistent wording.
No point logging the errno of fs_mgr_overlayfs_[setup|teardown]
because the error must already be logged by callee.

Bug: 241688845
Test: adb [disable|enable]-verity
Change-Id: I3a77fe567757ca6173e8c3142e77fef483d9b849
2022-08-11 17:23:13 +08:00
..
.clang-format
Android.bp set-verity-state: Start a threadpool to service waitForService() CB 2022-08-10 14:47:32 +08:00
OWNERS Add an OWNERS file for set-verity-state. 2022-08-05 21:09:05 +00:00
set-verity-state.cpp set-verity-state: Harden logic of overlayfs setup/teardown 2022-08-11 17:23:13 +08:00