No description
0aabcbc973
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 |
||
---|---|---|
bootstat | ||
cli-test | ||
code_coverage | ||
debuggerd | ||
diagnose_usb | ||
fastboot | ||
fs_mgr | ||
gatekeeperd | ||
healthd | ||
include | ||
init | ||
janitors | ||
libappfuse | ||
libasyncio | ||
libbinderwrapper | ||
libcrypto_utils | ||
libcutils | ||
libdiskconfig | ||
libgrallocusage | ||
libkeyutils | ||
libmodprobe | ||
libnetutils | ||
libpackagelistparser | ||
libprocessgroup | ||
libsparse | ||
libstats | ||
libsuspend | ||
libsync | ||
libsystem | ||
libsysutils | ||
libusbhost | ||
libutils | ||
libvndksupport | ||
llkd | ||
mini_keyctl | ||
mkbootfs | ||
property_service | ||
reboot | ||
rootdir | ||
run-as | ||
sdcard | ||
set-verity-state | ||
shell_and_utilities | ||
storaged | ||
toolbox | ||
trusty | ||
usbd | ||
watchdogd | ||
.clang-format | ||
.clang-format-2 | ||
.clang-format-4 | ||
.gitignore | ||
CleanSpec.mk | ||
METADATA | ||
MODULE_LICENSE_APACHE2 | ||
OWNERS | ||
PREUPLOAD.cfg | ||
rustfmt.toml |