summaryrefslogtreecommitdiff
path: root/fs_mgr
AgeCommit message (Collapse)Author
2022-05-02fs_mgr: Don't assume partitions replaced by DSU are logical alreadyTim Zimmermann
Test: Boot DSU on a device without dynamic partitions but first_stage_mount for /system Change-Id: I07f0f40037109aaaf1bce0151d1eac26c971ba9e
2022-05-02fs_mgr: Don't run clean_scratch_files on non-dynamic devicesNolen Johnson
* This results in a metric ton of denials on some devices and eats up valuable resources on boot, plus there's 0 need for it, so kill it. Change-Id: Ic52d5b3f06724430e9505345024cf0041b37ca49
2022-05-02Merge tag 'LA.QSSI.12.0.r1-06800-qssi.0' into sugisawa-mr1alk3pInjection
"LA.QSSI.12.0.r1-06800-qssi.0" Change-Id: I979d0f844cf44539ca87aade5929a4c84b4d31ff
2022-02-17Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: I682501b298008e130a29cab70f947f12c140e314
2022-01-26libfs_avb: Disable dm-verity when AVB is permissiveDanny Lin
When the bootloader is unlocked (i.e. AVB is permissive), enforcing dm-verity on system partitions is meaningless because the bootloader doesn't enforce verification on the root of the high-level verified boot chain: the kernel. As a result, mounting system partitions with dm-verity (hashtree verification) is futile when the code performing verification has not been verified in the first place; users can also disable dm-verity manually by flashing vbmeta with `fastboot flash --disable-verity vbmeta vbmeta.img`. For user and developer convenience, disable dm-verity automatically when the bootloader is unlocked by checking for permissive AVB. This makes it possible to ship enforcing vbmeta images for security-conscious users to lock their bootloader and reap the benefits of verified boot, while still allowing users with unlocked bootloaders to modify system partitions. Change-Id: Ie88362cfbda75561ef450e00fdc82ade221facb5
2022-01-20Merge tag 'LA.QSSI.12.0.r1-05800-qssi.0' into sugisawaalk3pInjection
"LA.QSSI.12.0.r1-05800-qssi.0" Change-Id: I057db3543fad7cab3fbda5a5ac742c92b2e2b3c5
2022-01-11Revert "Format formattable partitions if mount fails"Tom Marshall
This reverts commit 29dd6b6c01295222fee5ef2fc70692b2ecb12504. Change-Id: I7b76cd920019ae8cb7270b3f83e777ea9de7f7a4
2022-01-11remount: Fix failure for system-as-rootLeo Yan
Since commit 5ad7b3cbc5c1 ("Try to remount mounted points only"), the system-as-root cannot be remounted successfully when execute command "adb remount". This is because the mount point "/system" cannot be found and directly bails out with failure. Add an extra checking for the mount point "/system" for the system-as-root case, takes it as a found entry; thus the function can continue to run and fix up to remount root. Suggested-by: David Anderson <dvander@google.com> Signed-off-by: Leo Yan <leo.yan@linaro.org> Change-Id: Ia936c9d97bed951184813a087c70fe591cb33fe0
2022-01-07libsnapshot: Fix CHECK failure during second phase mergeDavid Anderson
This CHECK prevents a release build from resuming a two-phase merge if the merge initially failed in the first pass. Bug: 213031779 Bug: 213253413 Bug: 193549218 Ignore-AOSP-First: cherry-pick from AOSP Test: vts_libsnapshot_test Test: update_engine_unittests Change-Id: I8bf00e3016546ef7039bb0b18eb977cc3dc1066a Merged-In: I8bf00e3016546ef7039bb0b18eb977cc3dc1066a
2022-01-05libsnapshot: Propagate merge phase across merge failures.David Anderson
If a merge fails we write a new snapshot status indicating that the merge failed. If this happens to occur during the second merge phase, we fail to propagate the phase counter to the new status. This means the merge is unlikely to make progress and succeed later. Bug: 213031779 Bug: 213253413 Bug: 193549218 Ignore-AOSP-First: cherry-pick from AOSP Test: inject transient failure into CheckMergeConsistency, apply OTA, reboot and complete merge. Change-Id: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f Merged-In: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f
2022-01-04Deflake libdm#CreateEmptyDevice testNikita Ioffe
Judging from local experiments, it looks like device-mapper doesn't always generate a uevent after DM_DEV_CREATE ioctl. Test: presubmit Bug: 193462349 Change-Id: I8a74375631b20c14a32a41dbaf38380ebc0078e6 Merged-In: I8a74375631b20c14a32a41dbaf38380ebc0078e6
2021-12-19Merge s-mpr-2021-12-05Eric Arseneau
Change-Id: Id04e29c2e6639a50d8ad7accc675e03d38f50b6c
2021-12-06Merge mpr-2021-11-05Eric Arseneau
Change-Id: If5690578cd0c72b569f652ef97478356ba519bd1
2021-12-01snapuserd: Address alignment fault on 32-bit systemsAkilesh Kailash
When the scratch space is mmap'ed, the metadata buffer will be un-aligned. This may lead to alignment fault on 32-bit systems. Address this by temporarily copying it to buffer. No perf impact as this code path is not in I/O path and the copy is a for the size of metadata buffer which is 8k. Bug: 206426215 Test: Full and Incremental OTA on pixel 1: Compile snapuserd as 32 bit and reproduced the bug on pixel. 2: With fix - OTA applied successfully. 3: Reboot the device when merge was in-flight as the fix is primarily in that path. 4: Verify merge completion and data integrity post merge. Signed-off-by: Akilesh Kailash <akailash@google.com> Change-Id: Icd4a21d6a61f1ab36e65994c06a4d049a2ee741c Merged-In: I63c0d862057ebf138c9d1696a942030e30598739
2021-10-15Add CreateEmptyDevice and WaitForDevice APIsNikita Ioffe
These APIs support a flow in which dm devices can be created before they are actually needed, hence minimizing the time a process will wait for ueventd to create user space paths. Bug: 190618831 Test: atest libdm_test Change-Id: I4dfa14e5271a6a13de6da73ec3c7efb1ebc0f8b8
2021-10-07Add CreateEmptyDevice and WaitForDevice APIsNikita Ioffe
These APIs support a flow in which dm devices can be created before they are actually needed, hence minimizing the time a process will wait for ueventd to create user space paths. Bug: 190618831 Test: atest libdm_test Change-Id: I4dfa14e5271a6a13de6da73ec3c7efb1ebc0f8b8
2021-09-17Merge changes I779184f1,I241ee11d into sc-qpr1-dev am: d6383199e8Akilesh Kailash
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15825056 Change-Id: I1eb2a86623258bf10081f908bfc3b6187b244e93
2021-09-17snapuserd: I/O request on sectors not mapping to any COW op am: f7185915beAkilesh Kailash
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15825055 Change-Id: I329f41ed268bfcec88a024846e38223511b9b263
2021-09-17Merge changes I779184f1,I241ee11d into sc-qpr1-devAkilesh Kailash
* changes: libsnapshot: Error handling after QuerySnapshotStatus snapuserd: I/O request on sectors not mapping to any COW op
2021-09-17libsnapshot: Error handling after QuerySnapshotStatusAkilesh Kailash
QuerySnapshotStatus will capture the error codes from dm-snapshot if there are any snapshot related failure. Handle the error codes and fail the QuerySnapshotStatus call. Validate snapshot status in MapSnapshot(). If the mode is set to Persistent and snapshot status is in Merging state, then forcefully set the mode to Merge state. Bug: 198265278 Test: Full/incremental OTA Signed-off-by: Akilesh Kailash <akailash@google.com> Change-Id: I779184f1998b23edacd6e780acf2676442004340 Merged-In: I779184f1998b23edacd6e780acf2676442004340
2021-09-17snapuserd: I/O request on sectors not mapping to any COW opAkilesh Kailash
If there is an I/O request which doesn't map to any COW Operation in the vector mapping, then that request is an EOF request and should not be discarded with an I/O error. Bug: 198787355 Test: Incremental OTA Signed-off-by: Akilesh Kailash <akailash@google.com> Change-Id: I241ee11d7cf540854aa4a232bc1b18da43d41e05 Merged-In: I241ee11d7cf540854aa4a232bc1b18da43d41e05
2021-09-15libsnapshot: Fix new partitions not transitioning in second-stage init. am: ↵David Anderson
5932ed07db Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15832178 Change-Id: Icb3f865e7420772c45167d3d0d33f42b6cadb121
2021-09-15libsnapshot: Fix new partitions not transitioning in second-stage init.David Anderson
Bug: 196922070 Test: vts_libsnapshot_test Merged-In: If8a7afde218fd719e4426dc1dda41f53a4e6544b Change-Id: If8a7afde218fd719e4426dc1dda41f53a4e6544b
2021-08-27libsnapshot: Fix missing source partitions when adding a new partition. am: ↵David Anderson
0a6f250242 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15670247 Change-Id: Ieda77c5fc8cf867cb62054e0a38321fdf528e311
2021-08-25libsnapshot: Fix missing source partitions when adding a new partition.David Anderson
When adding a new partition, don't attempt to map a source partition during boot, because none exists. Instead use the base device. Bug: 196922070 Test: vts_libsnapshot_test Change-Id: Ice6015237b0a76a0210819994433e52159376393 Merged-In: Ice6015237b0a76a0210819994433e52159376393
2021-08-19Reduce the queue depth of loop devices used by the zram driverBart Van Assche
Make the queue depth of loop devices identical to that of the underlying storage device. This patch reduces latency by lowering the queue depth. With this patch applied I see the following: # cat /sys/block/loop30/queue/nr_requests 32 Bug: 194450129 Test: Built Android images, installed these and verified that the queue depth of loop devices is 32 instead of 256. Merged-In: Ifa16084c7df3a54d9559c2388abc4a8392ff88c6 Change-Id: Icc89e1f88d2f0ade2805999afef556b15b7ff8eb Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com> (cherry picked from commit 1a9cad816de296b3f5ee026869cab4413ec7527c)
2021-08-19libdm: Export ExtractBlockDeviceName()Bart Van Assche
Make this function available to libdm users. A caller outside libdm will be added by a later patch. Bug: 194450129 Test: mm libfs_mgr libdm_test Merged-In: I3e3560f3cdef8978eac644d5b53cf3851209c0c2 Change-Id: Ic05cc84565952662178bb649ec97cad6f76dcf92 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com> (cherry picked from commit 9e54a90e546b195dba1bfcd14df6d71bfbbdd60f)
2021-08-19libdm: Make ExtractBlockDeviceName() return its resultBart Van Assche
From https://engdoc.corp.google.com/eng/doc/devguide/cpp/styleguide.md: "Prefer using return values over output parameters: they improve readability, and often provide the same or better performance (see the C++ Primer)." Implement this advice for ExtractBlockDeviceName(). This patch does not change any functionality. Bug: 194450129 Test: mm libfs_mgr libdm_test Merged-In: I6363781163eba08e6128507b403200f472f68a59 Change-Id: I7d340b33281ebccded0836cd0b5a293e941f4043 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com> (cherry picked from commit 96b21cc589349d346e4c587d92867ddee66f45dd)
2021-08-19Rename two local variablesBart Van Assche
Improve code readability by renaming 'device' into 'loop_device' and 'device_fd' into 'loop_fd'. Bug: 194894000 Test: Built Android images and installed these on an Android device. Merged-In: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9 Change-Id: I3fa0c9ca53277b621bb5b81aca394a3079c6e0a3 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com> (cherry picked from commit c554240e647c14a5067537fcf8ef88e92b431e12)
2021-08-18Reduce the queue depth of loop devices used by the zram driver am: ↵Bart Van Assche
1a9cad816d am: d5a663fde4 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584614 Change-Id: I268f8e7799c66accbd293e7d331175eeff933872
2021-08-18Reduce the queue depth of loop devices used by the zram driver am: 1a9cad816dBart Van Assche
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584614 Change-Id: Id0a6c5b0e7c9cb118df02a9be768b3f68dde43a9
2021-08-18Reduce the queue depth of loop devices used by the zram driverBart Van Assche
Make the queue depth of loop devices identical to that of the underlying storage device. This patch reduces latency by lowering the queue depth. With this patch applied I see the following: # cat /sys/block/loop30/queue/nr_requests 32 Bug: 194450129 Test: Built Android images, installed these and verified that the queue depth of loop devices is 32 instead of 256. Merged-In: Ifa16084c7df3a54d9559c2388abc4a8392ff88c6 Change-Id: Icc89e1f88d2f0ade2805999afef556b15b7ff8eb Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-17Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev am: de0cc6cc59 ↵TreeHugger Robot
am: b155a9a8a1 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584613 Change-Id: Ib5046e3855f5c4249eed9676022a77aa93a1adce
2021-08-17Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev ↵TreeHugger Robot
am: 232ec664b1 am: 10e14c95bc Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612 Change-Id: I3b11fd3d20d34a9440ddb74e96a75922877534c7
2021-08-17Merge "Rename two local variables" into sc-dev am: d95943088e am: caef6def08TreeHugger Robot
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611 Change-Id: I5080775507f23eb67293aadc3e2ce4e7f42e3fd1
2021-08-17Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev am: de0cc6cc59TreeHugger Robot
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584613 Change-Id: I1221648f11e6fd2ccae40b1ad5d335c31ff8efa1
2021-08-17Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev ↵TreeHugger Robot
am: 232ec664b1 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612 Change-Id: I687f47d10a8aa8c955aab5e3c630f2c735e82c19
2021-08-17Merge "Rename two local variables" into sc-dev am: d95943088eTreeHugger Robot
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611 Change-Id: I1a7057d9dd955d425446985cf2ab16955efaa8ce
2021-08-16libdm: Export ExtractBlockDeviceName()Bart Van Assche
Make this function available to libdm users. A caller outside libdm will be added by a later patch. Bug: 194450129 Test: mm libfs_mgr libdm_test Merged-In: I3e3560f3cdef8978eac644d5b53cf3851209c0c2 Change-Id: Ic05cc84565952662178bb649ec97cad6f76dcf92 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16libdm: Make ExtractBlockDeviceName() return its resultBart Van Assche
From https://engdoc.corp.google.com/eng/doc/devguide/cpp/styleguide.md: "Prefer using return values over output parameters: they improve readability, and often provide the same or better performance (see the C++ Primer)." Implement this advice for ExtractBlockDeviceName(). This patch does not change any functionality. Bug: 194450129 Test: mm libfs_mgr libdm_test Merged-In: I6363781163eba08e6128507b403200f472f68a59 Change-Id: I7d340b33281ebccded0836cd0b5a293e941f4043 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16Rename two local variablesBart Van Assche
Improve code readability by renaming 'device' into 'loop_device' and 'device_fd' into 'loop_fd'. Bug: 194894000 Test: Built Android images and installed these on an Android device. Merged-In: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9 Change-Id: I3fa0c9ca53277b621bb5b81aca394a3079c6e0a3 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-12Merge "fs_mgr: Look for fstab file in /system/etc" into sc-qpr1-dev am: ↵Eric Biggers
1312688506 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15522163 Change-Id: I2c3b74e114c212a941a38131026dbd2e1aad2114
2021-08-10fs_mgr: Look for fstab file in /system/etcEric Biggers
Look for the fstab file in /system/etc as an alternative to /, in order to allow fstab files to be installed using the "prebuilt_etc" Soong module. This new path is meant to be used by the vendor ramdisk only. As before, fstabs should *not* be placed in /system/etc on the system partition. In more detail: sometimes, multiple nearly-identical fstabs need to be installed to a device, with the correct one being selected at boot time (b/191417025 as well as other cases that partners have run into). To avoid error-prone duplication of configuration files, these fstabs should be generated from a template by the build system instead of being duplicated in the source tree. But if this is done, the usual way of installing fstabs (PRODUCT_COPY_FILES) can't be used; they need to be made into real build system modules instead. Currently, the "prebuilt_etc" Soong module can't correctly install the vendor_ramdisk copy of the fstab(s), since it will install it into the /system/etc directory whereas Android currently requires that the vendor_ramdisk copy of the fstab(s) be placed in the root directory. Earlier I proposed adding a "prebuilt_fstab" module to handle this quirk (https://r.android.com/1744033). However, it was requested to instead always look for the fstabs in /etc too, in order to allow "prebuilt_etc" to be used and because /etc is the appropriate place for this file. This change implements that suggestion (but actually using /system/etc, since that is where "prebuilt_etc" actually installs it). Bug: 191417025 Test: Tested that a device boots both with this, both before and after http://ag/15075136 which uses the new location. Change-Id: Id083070e51ae85959167e4615cd96b31a0b1bd6a Merged-In: Id083070e51ae85959167e4615cd96b31a0b1bd6a (cherry picked from commit e98afa2687eb56184dad8569b929eba04fb93068)
2021-08-07Merge "Merge SP1A.210803.001" into s-keystone-qcom-devScott Lobdell
2021-08-04Merge SP1A.210803.001Scott Lobdell
Change-Id: Id2fbfa6a186ebfdc54c125b5232799b0eaa6a286
2021-08-03libsnapshot: Use std::unordered_set in DmSnapCowSizeCalculator.David Anderson
There is a check here if vector resize fails. In practice, this would throw bad_alloc or length_error and cause a runtime abort, so the check is dead code. To protect against bad chunk_ids we can switch to unordered_set instead. The original memory concerns for std::set are less applicable since unordered_set is bucketed. Bug: 194431534 CRs-Fixed: 2979666 Test: apply OTA; run vts_libsnapshot_tests Change-Id: I09c108b700d2f83acf80a9eaa5099b46aedcab89 (cherry picked from commit 8c1e93196b123f47b7e20277587a9a568bb83bc8)
2021-07-29Crash during OTA merge may lead to blocks with stale data am: 533c2f6d55Akilesh Kailash
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15413918 Change-Id: I09207d3a7d285d116be9b1fce86e62d5115124f5
2021-07-29Crash during OTA merge may lead to blocks with stale dataAkilesh Kailash
This is a corner case wherein a crash during OTA merge can lead to missing of some COW operations to be merged thereby some blocks may end up with stale data. Fix here is to avoid any re-ordering of COW operations. Merge the COW operations as present in the COW file. New tests have been added to cow_snapuserd. Bug: 194955361 Test: cow_snapuserd_test, Incremental OTA Signed-off-by: Akilesh Kailash <akailash@google.com> Merged-In: Id895fe7a3d6b4510676490a86d0caf62dec9b079 Change-Id: I14900b9537c4deb7824547e1dfe80f15274bdda4 Ignore-AOSP-First: manual merge from aosp
2021-07-12Merge SP1A.210709.002Haamed Gheibi
Change-Id: I63897770711a81d331de3f325affa88c3a56784f
2021-07-08Add CreateEmptyDevice and WaitForDevice APIsNikita Ioffe
These APIs support a flow in which dm devices can be created before they are actually needed, hence minimizing the time a process will wait for ueventd to create user space paths. Bug: 190618831 Test: atest libdm_test Change-Id: I4dfa14e5271a6a13de6da73ec3c7efb1ebc0f8b8 Merged-In: I4dfa14e5271a6a13de6da73ec3c7efb1ebc0f8b8 (cherry picked from commit 15e0f5a98acbec5f00f446ac61d6f79b9ee3bd80)