No description
Find a file
David Anderson 0aabcbc973 remount: Remove errno interaction from fs_mgr_overlayfs_teardown.
This patch eliminates errno as part of the return contract for
fs_mgr_overlayfs_teardown().

The non-standard use of implicit errno makes it extremely difficult to
reason about how these functions can fail. As it turns out,
fs_mgr_overlayfs_teardown has been consistently failing for a long time,
but in a place where errno isn't set, which meant "enable-verity" never
saw the failure.

The failure was originating from umount2(MNT_DETACH) which guaranteed
that DeleteBackingImage would fail with EBUSY, and DeleteBackingImage is
a binder call that doesn't set errno.

This patch switches to umount() and returns a "busy" status if the
unmount fails with EBUSY. In this case it will also disable the scratch
partition. There is a long-standing existing bug where, for non-VAB
devices, it will delete the underlying scratch partition off super. This
is pretty risky with MNT_DETACH, but that path is left unchanged here.

Some duplicated code in set-verity-state was refactored as well, since
the return value of fs_mgr_overlayfs_teardown is now more complex.

Bug: 241179247
Test: adb-remount-test.sh
Change-Id: I2ca75332b75a302622ba9b86d122a6f2accdda3e
2022-09-19 22:30:05 -07:00
bootstat Merge "boot_reason: Add reasons for boot_reason_test.sh" 2022-07-14 22:45:18 +00:00
cli-test
code_coverage
debuggerd Resolve ro.debuggable at build time 2022-09-01 13:32:36 +00:00
diagnose_usb
fastboot Add io_uring support to fastboot 2022-08-11 18:58:43 -07:00
fs_mgr remount: Remove errno interaction from fs_mgr_overlayfs_teardown. 2022-09-19 22:30:05 -07:00
gatekeeperd
healthd healthd: Fix charger_res_images_vendor install location 2022-08-26 15:58:07 +02:00
include
init Merge "init: remove unnecessary semicolon" 2022-09-02 11:39:05 +00:00
janitors
libappfuse
libasyncio
libbinderwrapper
libcrypto_utils
libcutils Add the "sys" group for tests. 2022-09-01 00:01:04 +00:00
libdiskconfig
libgrallocusage
libkeyutils
libmodprobe libmodprobe: check blockedlist if load failed 2022-08-06 04:48:55 +00:00
libnetutils Rewrite function declarators without prototypes 2022-06-22 16:59:22 +08:00
libpackagelistparser Promote HWASan tests to presubmit. 2022-06-17 22:18:49 +00:00
libprocessgroup libprocessgroup: Add I/O scheduler attributes to task_profiles.json 2022-08-25 14:01:01 -07:00
libsparse libsparse: Don't spam errors in sparse_file_import_auto. 2022-06-01 18:36:04 -07:00
libstats Promote HWASan tests to presubmit. 2022-08-10 19:50:31 +00:00
libsuspend
libsync Replace #apex with #systemapi 2022-07-17 17:43:24 +09:00
libsystem
libsysutils
libusbhost
libutils Remove unnecessary std::unary_function base classes 2022-08-26 20:24:57 -07:00
libvndksupport Replace #apex with #systemapi 2022-07-17 17:43:24 +09:00
llkd
mini_keyctl
mkbootfs Make 'mkbootfs' print a usage message for insufficent args. 2022-07-12 16:00:07 -07:00
property_service Promote HWASan tests to presubmit. 2022-05-06 19:08:21 +00:00
reboot
rootdir Prepare /data/property before load_persist_props 2022-08-18 10:03:02 +09:00
run-as
sdcard
set-verity-state remount: Remove errno interaction from fs_mgr_overlayfs_teardown. 2022-09-19 22:30:05 -07:00
shell_and_utilities
storaged storaged: Avoid divide-by-zero in performance measurement 2022-05-18 17:05:54 +09:00
toolbox
trusty trusty: Increase size of ACVP shared memory 2022-08-22 19:43:54 -07:00
usbd
watchdogd
.clang-format
.clang-format-2
.clang-format-4
.gitignore
CleanSpec.mk
METADATA
MODULE_LICENSE_APACHE2
OWNERS
PREUPLOAD.cfg Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00
rustfmt.toml Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00