Allow caller to pass additional flags when opening a partition. Obsolete
usage of boolean read, and make previous callers use O_RDONLY instead.
Explicitly OR (O_EXCL | O_CLOEXEC | O_BINARY) to keep existing design
working as is.
Test: flash locally and reach home screen
Bug: 205151372
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
Change-Id: I48fbca459a17fcf0b0926ab339585e3bd8e31e35
We've had two use-after-frees in the last month from this nonsense...
Bug: http://b/204925347
Test: treehugger
Change-Id: I5e1485253224e38ca51a7a077dbe65d19e39f817
This reverts commit 1cc9818642.
Reason for revert: Failing build - There is a dependency with https://r.android.com/c/1843772/3
Change-Id: Iccac56cf4c7012d8732b4338eb7055e1b2451e3b
Most of the test cases are similar to dm-snapshot-merge.
Additional test cases have been added primarily to test
I/O's in parallel with merge.
Bug: 193863397
Test: snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: If7fede1be6d678c8665e1f9369fd3c69f5d3c4df
* changes:
snapuserd: Sort REPLACE ops for batch merge
snapuserd: API to query snapshot and merge status
snapuserd: Wire up API's for Initiating and tracking Merge
snapuserd: I/O requests which are not block aligned.
snapuserd: Service I/O requests from dm-user
For the vendor variant of libhealthd_mode_charger, read resources
from /vendor. The core variant continues to read resources from
/product, /system, and /res.
Test: run charger from /vendor manually
Bug: 203246116
Change-Id: Ia9df1d081a51783409b5dbd3e3d4719efc3cb6a7
This is a prerequisite to move charger to vendor partition.
Because vendor domains can't read ro.charger.*, they are all assumed
to be the default value. They aren't set in the ecosystem anyway,
so it is time to deprecate them.
Test: builds
Bug: 203246116
Change-Id: I0b17e62ab3ac5a89df091333fd9f24e33bdfd49a
Since we will be iterating forward for user-space
merge, we need to sort the blocks in increasing order
so that blocks can be batch merged if contiguous.
For dm-snapshot merging, we will continue to sort
in decreasing order.
Bug: 193863397
Test: Snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I25fb5fce054f716a2ad0dddc0d0c3afef18bc7ad
Add new API to query the snapshot and merge status.
This will be used by libsnapshot.
Bug: 193863443
Test: Full OTA on CF
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I86cffff6a979e2e2bf1d8d1a1770e209eeb4a47d
Add new client API's for initiating and tracking merge.
These API's will be used by libsnapshot.
Track the merge completion in the server by walking through
all the partitions. Each worker thread will update the
merge completion as and when number of COW operations
are completed. Server will gather all the completions
of each partition and average it out. This is in sync
with the current merge completion tracking for dm-snapshot.
As a side effect, move the snapuserd_server.h/cpp files to
dm-snapshot-merge directory as it will only be a maintaining
code.
Bug: 193863443
Test: Snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I031eb1a11b0f426aafbed3d39d85b0c22b9030fb
If the I/O request is for a sector which is not block
aligned, then we will not find the mapping directly
to a COW op as each op is block aligned. Thus, we
handle them by chopping the I/O request and processing
the unaligned data. Furthermore, if the request
doesn't map to any of the COW ops, then route the
I/O to the base device.
Bug: 196929997
Test: Full OTA on CF - during boot up, we get an I/O request
to read superblock on system partition which is not block aligned.
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ie40633c0c6bc0c87b681c051c74c0ac787e34d9c
Now that merging is done in user-space and
partitions are mounted off dm-user directly,
daemon will have to serve every I/O request.
Daemon has to handle this wherein we need to
check if the given I/O request block has been
modified in the OTA. Furthermore, if merge is
in-progress, we will have to synchronize with
the merge thread before servicing the I/O.
If the I/O request maps to a REPLACE or ZERO op,
we will just read the data from COW device.
If the I/O request maps to a COPY or XOR op,
the worker thread will have to synchronize
with the merge thread and if the merge is
in progress, fetch the data directly from RA buffer.
This patch handles I/O requests only if the
sectors are 4k aligned.
Bug: 196929997
Test: snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I08562b8927e1c22dd9d9ef160e873280854eac99
Ensure we have at least one element before we try to access the last
element. Else the array index of the last element may underflow,
0ull - 1 == ~0ull == UINT64_MAX.
Bug: 204536075
Test: atest fiemap_writer_test
Change-Id: Ic390d108bf789cfe136fb5dfe2983f3c7d6f7e48
Bug: 201596822
Test: Local test (isolated to host)
$ adb -s 8BDAY00CM6 root
adbd is already running as root
$ adb -s 8BDAY00CM6 remount
Disabling verity for /system
Using overlayfs for /system
Disabling verity for /system_ext
Using overlayfs for /system_ext
Disabling verity for /vendor
Using overlayfs for /vendor
Disabling verity for /product
Using overlayfs for /product
remount succeeded.. now reboot device for settings refresh
$ echo $?
0
$ adb -s 8BDAY00CM6 unroot
restarting adbd as non root
$ adb -s 8BDAY00CM6 remount
Not running as root. Try "adb root" first.
remount failed
$ echo $?
3
Signed-off-by: Shaju Mathew <shaju@google.com>
Change-Id: I8e6d0735d2da0ed58cae867db2e4736abb86d351
The kernel can return different compatible ranges on each call, depending on
how it decides to merge contiguous extents in the results. To avoid the
complexity of requerying the ioctl, just do one query up to the maximum
allowed extent size.
Bug: 204536075
Test: install DSU on cuttlefish
fiemap_test
Change-Id: I4d569e3e6feed14c91a5f500296623888060dcad
The system property is set by vendor partition but owned by platform,
hence vendor domains can't read this value. Add an API in
ChargerConfigurationInterface so that HAL implementations can override
its value.
Other ro.charger.* sysprops are unused, hence no APIs are created for
them.
Test: manual
Bug: 203246116
Change-Id: I583c21e58ed3d912b156e253d6a4b46a0378f11e
Abstract all the HIDL-ness from charger so an AIDL HAL
can later replace the HIDL HAL.
Created libhealthd_charger_ui that is responsible for
UI stuff in charger. Then libhealthd_charger is now the
charger library backed by HIDL HAL.
Bug: 170338625
Bug: 203246116
Test: charger_test
Change-Id: I193bb76afa18b3367f24796ac53b1760650e8683
Should check ro.build.id instead of the ro.boot.build.id. The former
is a component of the build fingerprint.
Bug: 204507710
Test: run CtsInitTestCases
Change-Id: Iee13b30b195685c2461255f946685a288f352e06
This is probably an overkill, but still, add a collection of
interesting keywords that may appear in a fstab file.
Also add myself to the "CC" list of this fuzz target.
BYPASS_INCLUSIVE_LANGUAGE_REASON="slave" or MS_SLAVE is a mount flag
Bug: 204056804
Test: adb shell /data/fuzz/x86_64/libfstab_fuzzer/libfstab_fuzzer \
-dict=/data/fuzz/x86_64/libfstab_fuzzer/fstab.dict
Change-Id: Ife55837212a711dcbeed4f00d97da0cb022c7156
Just a modest initial implementation. Uses the fuzz data as the fstab
file content directly.
Bug: 204056804
Test: lunch aosp_cf_x86_64_phone-userdebug
SANITIZE_TARGET=address m libfstab_fuzzer
adb sync data
adb shell /data/fuzz/x86_64/libfstab_fuzzer/libfstab_fuzzer
Change-Id: I7976a6ee124e9b5da59cfa7f4bae9699be3f1474
Soong is installing binaries directly to HOST_OUT_EXECUTABLES instead
of SOONG_HOST_OUT_EXECUTABLES, dist from the HOST_OUT_EXECUTABLES
location.
Bug: 204136549
Test: m checkbuild
Change-Id: Iee7ae8d1ed478aa2a0344fc9f54ad2c146841cb0
UserLifecycleTests test disables all Little cores in the course of the
test, which causes attempts to add a process into /dev/cpuset/restricted
cpuset cgroup to fail with ENOSPC error code, indicating that a process
is joining a cpuset cgroup with no online cpus. Current libprocessgroup
implementation will log an error on each such occurrence, which spams
the logs and makes it hard to analyze test results. Because this
situation does not happen in production environment (we do not offline
cpus), we can prevent flooding the logs by identifying this case,
logging an appropriate error one time and ignore all later similar errors.
Bug: 158766131
Test: adb shell "echo 0 > /sys/devices/system/cpu/cpu[0-3]/online"
Test: start some apps, observe libprocessgroup errors in the logcat
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia91d8839d86787569c255481bde077be51c43d93
Create a new group for dex2oat in cpu cgroup, which is dedicated for
dex2oat processes. Also modify task profiles for this change.
Bug: 201223712
Test: dex2oat group created
Change-Id: Ic61f4b8a64d01c03549b680970805e12b9ce4fcc
This is required since Android 12, because
CtsNativeVerifiedBootTestCases will read property
"partition.${partition}.verified.hash_alg" to
check that sha1 is not used.
Also see https://r.android.com/1546980 for more details.
Bug: 175236047
Bug: 203720638
Test: build and boot a device
Change-Id: I300265f4af9c2781d40537f391bda9eaf62c27ba