There is a small change of behavior in this patch. If "remount"
specifies a list of arguments, and one of them is invalid, it will now
error rather than try to remount the remaining partitions.
Bug: 241179247
Test: remount
Change-Id: I7a9ef41886f32ae97173796358b41844a1e42ea8
Using vector + unordered_map to retrieve the index in
a COW op vector consumes significant memory; this
is a problem especially when there are hundreds
of thousands of operations.
Instead, just store the index of the COW op vector
during pre-processing.
On Pixel, peak memory usage when all the partitions
are mapped:
Without patch:
RssAnon: 118804 kB
With path:
RssAnon: 55772 kB
Additionally, post OTA reboot, memory usage further goes
down as the partition merge completes.
Bug: 238052240
Test: OTA on Pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Icc68a9688ceb89572821cee2dac689779f5e7c11
Fsync failures are special because they may indicate a failure of an
operation before the current operation. Report these cases as a new,
distinct error.
Test: Cause fsync failure and check error response
Bug: 239105007
Change-Id: Ie9d4a1949586e90006256c975786e21ced655e66
Previously we did not support STORAGE_MSG_FLAG_POST_COMMIT for anything
but RPMB operations (in which case it was a no-op). We need to support
this flag in order to store a superblock in non-secure storage, as we
need that write to commit atomically wrt all other writes.
Test: com.android.storage-unittest.nsp
Bug: 228793975
Change-Id: Ia453c1916970e0b65a91e42f18b920ac4e1f01db
We are now default restricting bindgen visibility to subpackages. This
change is part of a set of changes adding explicit visibility for
bindgen libraries which are already being used elsewhere.
* If these visibility rules are to allow access by the safe bindings
library which lives elsewhere in the codebase, no action is needed.
* If safe bindings do not exist, and you own this library, now is a good
time to think about producing them and transitioning your (now
enumerated) client list.
* If safe bindings exist, but there is a surprise client of the raw
bindings on this list, now is a good time to talk to them about why
they don't want to use your safe bindings.
Bug: 166332519
Test: m
Change-Id: I1320a72d61cf0d760da3e037dec6ad35c8c979f8
Surprised this isn't breaking anything, so wanted to
make sure it worked.
Bug: 232557259
Test: libutils_test
Change-Id: Iaec47d644c02dc190e397c6f84dcfab4cc76f566
Also add tighter checks to make sure we didn't drop events.
Bug: 240617890
Test: libtrusty_metrics_test
Change-Id: I0029d91ad0ff67eb97913b2316efca627b118616
Change -force_config to -force_mode. Change inputs to vab-legacy
(Android R) and vabc-legacy (Android S). Default is device
configuration. There is no explicit option for Android T since it is the
default.
This also adds -compression_method which overrides the default of "gz".
Bug: 208944665
Test: vts_libsnapshot_test -compression_method lz4
vts_libsnapshot_test -force_mode vab-legacy
vts_libsnapshot_test -force_mode vabc-legacy
Change-Id: Iedc9461325229ccffd84478e1971f8b6b959e160
vts_libsnapshot_test uses IPropertyFetcher, as does liblp, but
libsnapshot doesn't. Fix this by switching relevant cases in
utility.cpp.
This also changes SnapshotTestPropertyFetcher from a mocked class to a
pseudo-implementation. This is useful because sometimes we want the
actual device's properties and sometimes we don't, and this setup is
more flexible.
Bug: 208944665
Test: vts_libsnapshot_test
Change-Id: I58621281715b3efb045b6be6f788934fddaa1a0c
The compression.enabled property only refers to legacy snapuserd.
However, everywhere it's used, we almost always mean "using the new COW
format with snapuserd, whether compression is enabled or not".
This patch clarifies things by renaming "compression_enabled" fields to
"using_snapuserd".
This also simplifies the feature detection code quite a bit, by removing
some redundant checks and clarifying which cases are legacy vs userspace
snapshots.
Bug: 208944665
Test: vts_libsnapshot_test
apply OTA, snapshotctl dump
Change-Id: Ie617ed3f92eefb8dff0a5cf13e5a2caa47b9e8e0
1. integrate modules which have soft dependencies into parallel loading flow. First, check the soft dependencies are in `module.load` list. If yes, regard soft dependencies as hard dependencies and load the modules only when their dependencies are loaded. If not, abandon these soft dependencies.
2. also add an allowlist and use the term "load_sequential=1" to load specific modules in sequential.
Test: R4 saves 350ms+ (48%) to load all modules
Bug: 229794277
Signed-off-by: chungkai <chungkai@google.com>
Change-Id: I904fe31cd02f9d499dadc537335cadc88d8add70
Before, we only did this in sp<> constructors, but we can always make
this check during the initial incStrong.
Since prebuilts call into the existing report race function declared
in StrongPointer.h, we still call this function from RefBase.cpp.
Bug: 232557259
Test: libutils_test
Change-Id: I4080b1869b83ecf655fc9c182b6de768a6358adf
This adds a helper around WrapSnapshotAndHash to avoid manually calling
it as most tests have to do. It also changes the signature so a
PartitionUpdate is passed rather than a name, which gives access to
partition information for debugging.
Bug: 208944665
Test: builds
Change-Id: Icd1cdf9d49c48f5a44c35ab1b86f43287e429f86
This will be in sync with incremental OTA's where the sync
is done every 2MB. This improves performance on devices
with low memory.
Merge times for full OTA may increase by couple of seconds but
that is ok given it decreases the memory footprint.
Bug: 238052097
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ic2c8d2ffdbdb677e0c4d44e5de68ce8ccf86df34
This adds a test case for filesystems with larger than 4KiB alignment.
It creates a temporary FAT filesystem and attempts to create a backing
image. The actual size of the block device should be the requested size.
Test: fiemap_image_test
Bug: N/A
Change-Id: I8ef574b22dbf6d47f4855b7de681c927cf81f2b7
This fixes the regression of aosp/2153354.
SwitchToMountNamespaceIfNeeded() is supposed to switch between "default"
mount namespace and "bootstrap" mount namespace. But it shouldn't affect
services with its own mount namespace.
Bug: 239882455
Test: make a hal service start in a separate mount namespace
using 'namespace mnt' in its definition.
see the mount namespace of the service process
$ cat /proc/$(pgrep -f myservice)/ns/mnt
Change-Id: I8c80eaec723241c405f48980b9e88640123c43ad
Passed apex file name to service. The file name will be parsed
to determine 1) whether the service is from an apex; 2) apex name
Bug: 236090201
Change-Id: I2c292c0c067f4bf44bb25b1f80e4f972b94f7258
fastboot uses the internal functions generate_ext4_image and
generate_f2fs_image when called via the `format` subcommand. An option
for populating the newly created fs with an initial directory exists,
but it is not exposed to the command line interface (initial_dir is
always ""). Remove the unused codepaths for this preloading.
Test: atest --host fastboot_test
Bug: 237960487
Change-Id: I7acfe6352cf26b5cbe0e5553b288c3798e96a893
b/239574953 uncovers an obscure test device configuration that breaks
with aosp/2146960.
Without aosp/2146960, "/system" is not a mountpoint, because after
switch_root, the "/system" mount entry becomes "/", thus changing the
subtree propagation type of "/system" would fail.
With aosp/2146960, "/system" is bind-mounted to itself after
switch_root, ensuring "/system" being a mountpoint, thus changing the
subtree propagation type of "/system" is allowed.
Before we can re-land aosp/2146960, just try both "/system" and "/"
when changing the subtree shared propagation type of "/system", so
both scenarios are handled.
Test: Add submount under /system and adb remount
Change-Id: I4006a5c1b1987d5f6452efa069ec5c7d2ac7c8ec