platform_system_core/fs_mgr/libsnapshot
Akilesh Kailash cffa413de4 snapuserd: I/O request on overlapping blocks during snapshot-merge.
This fixes the case when all the following conditions are true:

1: Incremental OTA
2: When there are sequence of overlapping COPY operations within one merge-window
   (510 blocks)
3: Device is rebooted when snapshot-merge is in-progress of this
   merge-window. When device reboots, the state of merge-window (of 510 blocks) was
   merge-in-progress (aka - only partial set of blocks were merged in
   this window thereby the state of the base device is in-complete for
   this window)
4: During the next boot, if there any I/O request from the filesystem
   which maps to the merge-window in (3):
   	a: The data has to be retrieved from the scratch space of the
	COW until the snapshot-merge for that window is completed.

	b: Once the snapshot-merge is complete for that window, data
	has to be retrieved from base device.

The bug was in step 4(a) wherein I/O request was getting routed to base
device.

This patch addresses the above flow by fixing step 4(a).

A new vts test has been added to explicitly track this issue.

Additionally, there is no need to re-scan the partition if partition is in merge resume path. This should cut down the overhead of the scan.

Bug: 275296365
Test: 1: 100 iterations of ./vts_snapuserd_test --gtest_filter=SnapuserdTest.Snapshot_COPY_Overlap_Merge_Resume_IO_Validate_TEST
2: Incremental OTA on Pixel 6 Pro with multiple iterations of device
   reboot when merge is in progress

Change-Id: Ib53be7f07ff192a84ec7f7049b2c6be01dad1041
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-10-05 05:32:31 +00:00
..
android/snapshot Remove the libsnapshot fuzzer. 2023-03-09 08:35:49 -08:00
include/libsnapshot Updating comments on cow layout 2023-09-18 14:02:17 -07:00
include_test/libsnapshot libsnapshot: Remove ISnapshotWriter. 2023-06-14 12:03:58 -07:00
libsnapshot_cow inspect_cow: Add an --extract-to argument. 2023-10-03 16:02:26 -07:00
scripts Add LOCAL_LICENSE_KINDS to system/core/fs_mgr 2021-09-15 10:57:11 -07:00
snapuserd snapuserd: I/O request on overlapping blocks during snapshot-merge. 2023-10-05 05:32:31 +00:00
tools Add copyright to libsnapshot/tools 2023-09-26 16:51:53 -07:00
Android.bp Reland exporting create_snapshot 2023-09-07 17:05:50 +00:00
device_info.cpp Convert fastboot/libsnapshot to new BootControl client 2022-07-08 10:57:53 -07:00
device_info.h Convert fastboot/libsnapshot to new BootControl client 2022-07-08 10:57:53 -07:00
dm_snapshot_internals.h libsnapshot: Use std::unordered_set in DmSnapCowSizeCalculator. 2021-07-30 11:02:28 -07:00
OWNERS Update bug component from Android Systems to OTA client 2023-08-22 10:18:47 +01:00
partition_cow_creator.cpp libsnapshot: Clarify the meaning of "compression.enabled". 2022-07-27 18:32:15 -07:00
partition_cow_creator.h Initialize COW options using update manifest 2023-02-23 13:21:20 -08:00
partition_cow_creator_test.cpp libsnapshot: Clarify the meaning of "compression.enabled". 2022-07-27 18:32:15 -07:00
return.cpp libsnapshot: delete WaitForMerge. 2020-03-03 13:19:49 -08:00
snapshot.cpp libsnapshot_cow: Prepare device to boot from pre-created snapshots 2023-09-08 23:09:45 -07:00
snapshot_metadata_updater.cpp Merge "libsnapshot: Properly set partial_update_" 2020-07-31 23:02:05 +00:00
snapshot_metadata_updater.h Update libsnapshot to handle partial update 2020-06-09 12:53:45 -07:00
snapshot_metadata_updater_test.cpp libsnapshot_test: skip global setup on non-VAB devices. 2020-08-06 17:21:50 -07:00
snapshot_stats.cpp libsnapshot: Add more feature flags to SnapshotMergeReport. 2022-05-25 13:40:31 -07:00
snapshot_stub.cpp libsnapshot: Remove ISnapshotWriter. 2023-06-14 12:03:58 -07:00
snapshot_test.cpp libsnapshot_cow: Prepare device to boot from pre-created snapshots 2023-09-08 23:09:45 -07:00
snapshotctl.cpp libsnapshot_cow: Prepare device to boot from pre-created snapshots 2023-09-08 23:09:45 -07:00
test_helpers.cpp libsnapshot: Remove ISnapshotWriter. 2023-06-14 12:03:58 -07:00
utility.cpp libsnapshot: Fix test failures on certain configurations. 2023-03-06 23:21:25 +00:00
utility.h libsnapshot: Fix test failures on certain configurations. 2023-03-06 23:21:25 +00:00
vts_ota_config_test.cpp Some device that platform base on android12 doesn't support A/B update, it looks virtual A/B is also not mandatory. so this test case should check ro.vendor.api_level first. 2022-09-17 06:47:02 +00:00