OSDN Git Service

android-x86/system-vold.git
3 years ago[automerger skipped] Merge "Add '-unstable' to solve ODR violation" am: f7794b5dc1...
Treehugger Robot [Fri, 11 Sep 2020 09:29:33 +0000 (09:29 +0000)]
[automerger skipped] Merge "Add '-unstable' to solve ODR violation" am: f7794b5dc1 am: 5724e15454 -s ours

am skip reason: Change-Id Id3c4bbc9149ba7c3e0a0d728026f02f60cb17424 with SHA-1 44b2f954be is in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1400407

Change-Id: Iba1f2ef22059f905091e742f8041e675a6f76d77

3 years agoMerge "Add '-unstable' to solve ODR violation" am: f7794b5dc1
Treehugger Robot [Fri, 11 Sep 2020 08:40:46 +0000 (08:40 +0000)]
Merge "Add '-unstable' to solve ODR violation" am: f7794b5dc1

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1400407

Change-Id: I44aea35571e4dff7f9f1010325f51d0e98dc01f1

3 years agoMerge "Add '-unstable' to solve ODR violation"
Treehugger Robot [Fri, 11 Sep 2020 08:19:44 +0000 (08:19 +0000)]
Merge "Add '-unstable' to solve ODR violation"

3 years agoAdd '-unstable' to solve ODR violation
Jeongik Cha [Fri, 14 Aug 2020 14:51:36 +0000 (23:51 +0900)]
Add '-unstable' to solve ODR violation

The interface which is imported by an unstable interface is 'unstable'
as well. Until now, the ODR violation checker in aidl has omitted an
interface imported, but it will be checked, accordingly, fix the current
problem

Bug: 146436251
Test: m nothing
Change-Id: Id3c4bbc9149ba7c3e0a0d728026f02f60cb17424
Merged-In: Id3c4bbc9149ba7c3e0a0d728026f02f60cb17424
Exempt-From-Owner-Approval: cp from internal

3 years ago[automerger skipped] Merge "Merge Android R" am: 141c2027e2 -s ours am: 789d1d0866...
Xin Li [Fri, 11 Sep 2020 02:02:43 +0000 (02:02 +0000)]
[automerger skipped] Merge "Merge Android R" am: 141c2027e2 -s ours am: 789d1d0866 -s ours

am skip reason: Change-Id I477d2dfba05718c829fdb2099248a8baba1125ab with SHA-1 8743ef4ea6 is in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1422563

Change-Id: Ic319ade87dab6280b771d6f8d91d7bfde3a056fe

3 years ago[automerger skipped] Merge "Merge Android R" am: 141c2027e2 -s ours
Xin Li [Fri, 11 Sep 2020 00:40:18 +0000 (00:40 +0000)]
[automerger skipped] Merge "Merge Android R" am: 141c2027e2 -s ours

am skip reason: Change-Id I477d2dfba05718c829fdb2099248a8baba1125ab with SHA-1 8743ef4ea6 is in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1422563

Change-Id: I78dff452b759e863b082f44b76fb5ae9a83cb704

3 years agoMerge "Merge Android R"
Xin Li [Thu, 10 Sep 2020 17:22:31 +0000 (17:22 +0000)]
Merge "Merge Android R"

3 years agoMerge Android R
Xin Li [Thu, 10 Sep 2020 03:21:28 +0000 (20:21 -0700)]
Merge Android R

Bug: 168057903
Merged-In: I477d2dfba05718c829fdb2099248a8baba1125ab
Change-Id: Ib60b99425dc79ca4c5b23772f32036f4e17ad11f

3 years agoMerge "bench: Add inodeop_bench benchmark" am: e804806d79 am: 8743ef4ea6
Treehugger Robot [Wed, 9 Sep 2020 13:50:13 +0000 (13:50 +0000)]
Merge "bench: Add inodeop_bench benchmark" am: e804806d79 am: 8743ef4ea6

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1421048

Change-Id: I1071fd34394aefcc2fc2e5bfd29e97df6dc28072

3 years agoMerge "bench: Add inodeop_bench benchmark" am: e804806d79
Treehugger Robot [Wed, 9 Sep 2020 13:34:41 +0000 (13:34 +0000)]
Merge "bench: Add inodeop_bench benchmark" am: e804806d79

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1421048

Change-Id: I477d2dfba05718c829fdb2099248a8baba1125ab

3 years agoMerge "bench: Add inodeop_bench benchmark"
Treehugger Robot [Wed, 9 Sep 2020 13:03:12 +0000 (13:03 +0000)]
Merge "bench: Add inodeop_bench benchmark"

3 years agobench: Add inodeop_bench benchmark
Stefano Duo [Mon, 7 Sep 2020 16:30:49 +0000 (16:30 +0000)]
bench: Add inodeop_bench benchmark

Add new benchmark capable of generating specific inode operations
workloads. Currently, it supports create, delete, move, hardlink and
symlink.

Test: Manual run on cuttlefish and physical device
Bug: 165903680
Signed-off-by: Stefano Duo <stefanoduo@google.com>
Change-Id: Ia47f259b7ccea5fe1665b272c3cbc9ec1bf2eb56

3 years ago[automerger skipped] Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709) am...
Xin Li [Tue, 1 Sep 2020 20:37:11 +0000 (20:37 +0000)]
[automerger skipped] Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709) am: 24ae202734 -s ours

am skip reason: Change-Id Id417587a550b0f4abf5a6a3e4b4535011b21f627 with SHA-1 dd8b695c61 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/12470406

Change-Id: Id0bdc9b0190233ed0384b52a5844597b337833e1

3 years agoMerge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Xin Li [Thu, 27 Aug 2020 17:17:42 +0000 (10:17 -0700)]
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)

Bug: 166295507
Merged-In: Id417587a550b0f4abf5a6a3e4b4535011b21f627
Change-Id: Ibb5e8cf5f36dad408cf047dd0498aba24249b695

3 years agoAdd '-unstable' to solve ODR violation
Jeongik Cha [Fri, 14 Aug 2020 14:51:36 +0000 (23:51 +0900)]
Add '-unstable' to solve ODR violation

The interface which is imported by an unstable interface is 'unstable'
as well. Until now, the ODR violation checker in aidl has omitted an
interface imported, but it will be checked, accordingly, fix the current
problem

Bug: 146436251
Test: m nothing
Change-Id: Id3c4bbc9149ba7c3e0a0d728026f02f60cb17424

3 years agoMerge "Add maco@ to vold OWNERS." am: 157a08bb92 am: 3d1b6ac7c0
Treehugger Robot [Tue, 11 Aug 2020 11:13:35 +0000 (11:13 +0000)]
Merge "Add maco@ to vold OWNERS." am: 157a08bb92 am: 3d1b6ac7c0

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1396467

Change-Id: I02184aa11a783fb3201812d2a8f64faca981cbc2

3 years agoMerge "Add maco@ to vold OWNERS." am: 157a08bb92
Treehugger Robot [Tue, 11 Aug 2020 10:56:15 +0000 (10:56 +0000)]
Merge "Add maco@ to vold OWNERS." am: 157a08bb92

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1396467

Change-Id: I0d0a8048465e190105f03dfe76fbf5c8393a4198

3 years agoMerge "Add maco@ to vold OWNERS."
Treehugger Robot [Tue, 11 Aug 2020 10:34:17 +0000 (10:34 +0000)]
Merge "Add maco@ to vold OWNERS."

3 years agoAdd maco@ to vold OWNERS.
Martijn Coenen [Tue, 11 Aug 2020 07:13:27 +0000 (09:13 +0200)]
Add maco@ to vold OWNERS.

Bug: N/A
Test: N/A
Change-Id: Ib00991eccbd33e719a64d55da932f7f2bfab7b71

3 years agoMerge "vold: use __ANDROID_API_Q__ instead of pre_gki_level" am: ee1a70c129 am: c6f47...
Eric Biggers [Mon, 10 Aug 2020 23:10:18 +0000 (23:10 +0000)]
Merge "vold: use __ANDROID_API_Q__ instead of pre_gki_level" am: ee1a70c129 am: c6f47996d6

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1395128

Change-Id: I14257e5e427795e8871de5df94696e49766566a6

3 years agoMerge "vold: use __ANDROID_API_Q__ instead of pre_gki_level" am: ee1a70c129
Eric Biggers [Mon, 10 Aug 2020 22:53:51 +0000 (22:53 +0000)]
Merge "vold: use __ANDROID_API_Q__ instead of pre_gki_level" am: ee1a70c129

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1395128

Change-Id: Iacb41f3dba6c2a57943f766b749d87efe6f4e4b3

3 years agoMerge "vold: use __ANDROID_API_Q__ instead of pre_gki_level"
Eric Biggers [Mon, 10 Aug 2020 22:35:21 +0000 (22:35 +0000)]
Merge "vold: use __ANDROID_API_Q__ instead of pre_gki_level"

3 years agovold: use __ANDROID_API_Q__ instead of pre_gki_level
Eric Biggers [Mon, 10 Aug 2020 17:55:56 +0000 (10:55 -0700)]
vold: use __ANDROID_API_Q__ instead of pre_gki_level

The name "pre_gki_level" is causing some confusion because not all
devices launching with Android R are subject to the GKI requirement.
(See b/161563110#comment11.)  E.g., devices that use a 4.14-based kernel
are exempt from GKI.  However, the encryption requirements still apply.

Just use __ANDROID_API_Q__ directly instead.

No change in behavior.

Change-Id: Id02ae1140845ac1ae7cf78be4e57fe34da028abf

3 years agoMerge "EncryptInPlace: ensure that backup superblocks get encrypted" am: 213dbe30a1...
Eric Biggers [Mon, 10 Aug 2020 18:22:03 +0000 (18:22 +0000)]
Merge "EncryptInPlace: ensure that backup superblocks get encrypted" am: 213dbe30a1 am: 5acfc3e8d5

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1385029

Change-Id: I28615b8a9a656804b8ebacff0876e2acb1a64c1f

3 years agoMerge "EncryptInPlace: ensure that backup superblocks get encrypted" am: 213dbe30a1
Eric Biggers [Mon, 10 Aug 2020 18:04:57 +0000 (18:04 +0000)]
Merge "EncryptInPlace: ensure that backup superblocks get encrypted" am: 213dbe30a1

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1385029

Change-Id: I29e6eab9571d4556883594049f4abc33d9ffa674

3 years agoMerge "EncryptInPlace: ensure that backup superblocks get encrypted"
Eric Biggers [Mon, 10 Aug 2020 17:52:39 +0000 (17:52 +0000)]
Merge "EncryptInPlace: ensure that backup superblocks get encrypted"

3 years agoEncryptInPlace: ensure that backup superblocks get encrypted
Will Shiu [Wed, 29 Jul 2020 09:03:17 +0000 (17:03 +0800)]
EncryptInPlace: ensure that backup superblocks get encrypted

Block groups with EXT4_BG_BLOCK_UNINIT still have backup superblocks
(and backup block group descriptors).  Fix EncryptInPlace to encrypt
these backup superblocks rather than leave them unencrypted.

Previously leaving the backup superblocks unencrypted didn't cause any
problems, but due to system/core commit 72abd7b246f7 ("Try to recover
corrupted ext4 /data with backup superblock") it is causing problems.

Bug: 162479411
Bug: 161871210
Change-Id: Ic090bf4e88193b289b04c5254ddf661ef40b037e

4 years agoMerge "vold: restore -D__ANDROID_DEBUGGABLE__" am: 5de675c93b am: bb92ff6591
Treehugger Robot [Fri, 17 Jul 2020 19:02:45 +0000 (19:02 +0000)]
Merge "vold: restore -D__ANDROID_DEBUGGABLE__" am: 5de675c93b am: bb92ff6591

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1365586

Change-Id: Id417587a550b0f4abf5a6a3e4b4535011b21f627

4 years agoMerge "vold: restore -D__ANDROID_DEBUGGABLE__" am: 5de675c93b
Treehugger Robot [Fri, 17 Jul 2020 18:38:05 +0000 (18:38 +0000)]
Merge "vold: restore -D__ANDROID_DEBUGGABLE__" am: 5de675c93b

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1365586

Change-Id: Ibb6947f1fad7a31cf2a42c3604c76fcf45a7082a

4 years agoMerge "vold: restore -D__ANDROID_DEBUGGABLE__"
Treehugger Robot [Fri, 17 Jul 2020 18:24:51 +0000 (18:24 +0000)]
Merge "vold: restore -D__ANDROID_DEBUGGABLE__"

4 years agovold: restore -D__ANDROID_DEBUGGABLE__
Mark Salyzyn [Fri, 17 Jul 2020 15:17:50 +0000 (08:17 -0700)]
vold: restore -D__ANDROID_DEBUGGABLE__

Regression introduced by
commit 7ebcc2bcfde2cf6713e2975224034b06ba0943d8
("Revert "[Vold] Conditional dependency to ARC++ ObbVolume"")
errantly removed the product_variables support for
-D__ANDROID_DEBUGGABLE__ when built for userdebug builds.

Restore stanza.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 161454607
Test: adb-remount-test no longer reports a problem
Change-Id: Ia7e55d1174fa7fac2d934d4aac06d15e8be388af

4 years agoMerge "KeyUtil: use static local variable in isFsKeyringSupported()" am: 256b23b1c5...
Eric Biggers [Fri, 17 Jul 2020 01:50:24 +0000 (01:50 +0000)]
Merge "KeyUtil: use static local variable in isFsKeyringSupported()" am: 256b23b1c5 am: 350b5ae900

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1365220

Change-Id: Ia7fca6e61c58317002271c8338bb01a12e8223a5

4 years agoMerge "vold: drop local fscrypt UAPI definitions" am: 47425d05a9 am: 83a3eecc03
Eric Biggers [Fri, 17 Jul 2020 01:50:07 +0000 (01:50 +0000)]
Merge "vold: drop local fscrypt UAPI definitions" am: 47425d05a9 am: 83a3eecc03

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1365221

Change-Id: Iffa50e4c549469de6425134369e609856f1d7813

4 years agoMerge "KeyUtil: use static local variable in isFsKeyringSupported()" am: 256b23b1c5
Eric Biggers [Fri, 17 Jul 2020 01:38:51 +0000 (01:38 +0000)]
Merge "KeyUtil: use static local variable in isFsKeyringSupported()" am: 256b23b1c5

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1365220

Change-Id: I94b778955b2ee5cd8c462050e94c39ce05c96179

4 years agoMerge "vold: drop local fscrypt UAPI definitions" am: 47425d05a9
Eric Biggers [Fri, 17 Jul 2020 01:38:44 +0000 (01:38 +0000)]
Merge "vold: drop local fscrypt UAPI definitions" am: 47425d05a9

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1365221

Change-Id: If47e4ced3b37e44772d802fb8ebe2d9ad51c03e2

4 years agoMerge "KeyUtil: use static local variable in isFsKeyringSupported()"
Eric Biggers [Fri, 17 Jul 2020 01:20:43 +0000 (01:20 +0000)]
Merge "KeyUtil: use static local variable in isFsKeyringSupported()"

4 years agoMerge "vold: drop local fscrypt UAPI definitions"
Eric Biggers [Fri, 17 Jul 2020 01:19:39 +0000 (01:19 +0000)]
Merge "vold: drop local fscrypt UAPI definitions"

4 years agovold: drop local fscrypt UAPI definitions
Eric Biggers [Thu, 16 Jul 2020 23:31:00 +0000 (16:31 -0700)]
vold: drop local fscrypt UAPI definitions

Now that Bionic's copy of <linux/fscrypt.h> has been updated, there's no
need for vold to carry its own fscrypt_uapi.h.

Test: build
Change-Id: I61581ac74f7cf77bc8a835e64d96553a9d0c517a

4 years agoKeyUtil: use static local variable in isFsKeyringSupported()
Eric Biggers [Thu, 16 Jul 2020 21:29:59 +0000 (14:29 -0700)]
KeyUtil: use static local variable in isFsKeyringSupported()

Use C++'s built-in mechanism for one-time initialization rather than
implement it ourselves in a way that isn't thread-safe.

(It doesn't *actually* need to be thread-safe, since all callers of this
run under ACQUIRE_CRYPT_LOCK.  But that's not easy to verify.)

Test: booted Cuttlefish and checked log for the one-time message
      "Detected support for FS_IOC_ADD_ENCRYPTION_KEY"
Change-Id: I6ca5b143ca305fa95144e388efc9657e3507bf05

4 years agoMerge "vold: remove checkEncryption" am: 2d9777bfbf am: 15c0d3e5d0
Eric Biggers [Thu, 16 Jul 2020 21:00:33 +0000 (21:00 +0000)]
Merge "vold: remove checkEncryption" am: 2d9777bfbf am: 15c0d3e5d0

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1363339

Change-Id: I23b9a01632b61a92896ae83e2152fa047dd85c48

4 years agoMerge "vold: remove checkEncryption" am: 2d9777bfbf
Eric Biggers [Thu, 16 Jul 2020 20:45:57 +0000 (20:45 +0000)]
Merge "vold: remove checkEncryption" am: 2d9777bfbf

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1363339

Change-Id: I4ffa4a351292c18dce51247d926ffe7efdbd5bea

4 years agoMerge "vold: remove checkEncryption"
Eric Biggers [Thu, 16 Jul 2020 20:30:35 +0000 (20:30 +0000)]
Merge "vold: remove checkEncryption"

4 years agoMerge "Revert "[Vold] Conditional dependency to ARC++ ObbVolume"" am: 6e6fc6b8d3...
Treehugger Robot [Thu, 16 Jul 2020 12:03:40 +0000 (12:03 +0000)]
Merge "Revert "[Vold] Conditional dependency to ARC++ ObbVolume"" am: 6e6fc6b8d3 am: 11757842a3

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1320919

Change-Id: Iec0c1190443f1366a0f105bb3eba3967635ff544

4 years agoMerge "Revert "[Vold] Conditional dependency to ARC++ ObbVolume"" am: 6e6fc6b8d3
Treehugger Robot [Thu, 16 Jul 2020 11:51:01 +0000 (11:51 +0000)]
Merge "Revert "[Vold] Conditional dependency to ARC++ ObbVolume"" am: 6e6fc6b8d3

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1320919

Change-Id: I6fb0ca30c54791549923099c1acf74667e06ae5b

4 years agoMerge "Revert "[Vold] Conditional dependency to ARC++ ObbVolume""
Treehugger Robot [Thu, 16 Jul 2020 11:04:04 +0000 (11:04 +0000)]
Merge "Revert "[Vold] Conditional dependency to ARC++ ObbVolume""

4 years agovold: remove checkEncryption
Eric Biggers [Wed, 15 Jul 2020 18:06:02 +0000 (11:06 -0700)]
vold: remove checkEncryption

The testing-only "checkEncryption" command has been replaced with
VtsKernelEncryptionTest [1].  In particular, the metadata encryption
documentation [2] no longer mentions checkEncryption but rather
recommends running VtsKernelEncryptionTest.  Also, checkEncryption
hasn't really been maintained, and it has some known bugs; it's unclear
that many people ever really used it.

So, just remove it.

[1] https://android.googlesource.com/platform/test/vts-testcase/kernel/+/refs/heads/master/encryption/
[2] https://source.android.com/security/encryption/metadata#tests

Bug: 155037012
Change-Id: I258829c60768fd11aafdf2faad956cecc1ae9826

4 years agoRevert "[Vold] Conditional dependency to ARC++ ObbVolume"
Satoshi Niwa [Mon, 1 Jun 2020 12:03:36 +0000 (21:03 +0900)]
Revert "[Vold] Conditional dependency to ARC++ ObbVolume"

This reverts commit aedae617fec702add64201534a2f514fa31c5965.

Reason for revert: ArcObbVolume is not needed by ARCVM R and above.

Bug: 157885448
Test: trybot
Change-Id: I16395ac8b6902cedea263f51e306b297d719043f

4 years ago[automerger skipped] vold: only allow emmc_optimized on eMMC storage am: 006eed8e3a...
Eric Biggers [Wed, 8 Jul 2020 00:22:58 +0000 (00:22 +0000)]
[automerger skipped] vold: only allow emmc_optimized on eMMC storage am: 006eed8e3a -s ours

am skip reason: Change-Id Ie27b80658db53b1a4207b3cbb4e309d05130812e with SHA-1 eb566d0a7c is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/12098822

Change-Id: Id8c90f1833a171c12936a5f4aa2bf80574f5cb64

4 years agoMerge "vold: only allow emmc_optimized on eMMC storage" am: 428ae6e90a am: 7a1c4ccb96
Eric Biggers [Tue, 7 Jul 2020 17:37:34 +0000 (17:37 +0000)]
Merge "vold: only allow emmc_optimized on eMMC storage" am: 428ae6e90a am: 7a1c4ccb96

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1356175

Change-Id: Ie124c2cec8e4235ae999463d5c03615880e0c01e

4 years agoMerge "vold: only allow emmc_optimized on eMMC storage" am: 428ae6e90a
Eric Biggers [Tue, 7 Jul 2020 17:24:35 +0000 (17:24 +0000)]
Merge "vold: only allow emmc_optimized on eMMC storage" am: 428ae6e90a

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1356175

Change-Id: I95f471e6a2a96929b1ff854cac195b68e86309f3

4 years agovold: only allow emmc_optimized on eMMC storage
Eric Biggers [Mon, 6 Jul 2020 20:46:38 +0000 (13:46 -0700)]
vold: only allow emmc_optimized on eMMC storage

The emmc_optimized encryption flag is specifically designed for the
limitations of inline encryption hardware that follows the eMMC
standard.  It isn't appropriate to use on other types of storage.
So, make vold enforce that it's not used on other types of storage.

Bug: 160639344
Test:
  - Enabled emmc_optimized on Cuttlefish and verified it no longer boots
  - Using a modified version of this change, verified that
    IsEmmcStorage() works as expected on various devices including
    Cuttlefish, Cuttlefish booted in GSI image mode, a device with eMMC
    storage, and a device with UFS storage.
  - Verified that VtsKernelEncryptionTest still passes
Change-Id: Ie27b80658db53b1a4207b3cbb4e309d05130812e
Merged-In: Ie27b80658db53b1a4207b3cbb4e309d05130812e

4 years agoMerge "vold: only allow emmc_optimized on eMMC storage"
Eric Biggers [Tue, 7 Jul 2020 17:07:58 +0000 (17:07 +0000)]
Merge "vold: only allow emmc_optimized on eMMC storage"

4 years agovold: only allow emmc_optimized on eMMC storage
Eric Biggers [Mon, 6 Jul 2020 20:46:38 +0000 (13:46 -0700)]
vold: only allow emmc_optimized on eMMC storage

The emmc_optimized encryption flag is specifically designed for the
limitations of inline encryption hardware that follows the eMMC
standard.  It isn't appropriate to use on other types of storage.
So, make vold enforce that it's not used on other types of storage.

Bug: 160639344
Test:
  - Enabled emmc_optimized on Cuttlefish and verified it no longer boots
  - Using a modified version of this change, verified that
    IsEmmcStorage() works as expected on various devices including
    Cuttlefish, Cuttlefish booted in GSI image mode, a device with eMMC
    storage, and a device with UFS storage.
  - Verified that VtsKernelEncryptionTest still passes
Change-Id: Ie27b80658db53b1a4207b3cbb4e309d05130812e

4 years agoConfigure backing device max_ratio for FUSE filesystems. am: a485006ab1
Martijn Coenen [Tue, 30 Jun 2020 09:57:21 +0000 (09:57 +0000)]
Configure backing device max_ratio for FUSE filesystems. am: a485006ab1

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/12024019

Change-Id: I5cd116bfb01b0fe98dfdcd7d4b8005819ccfeb11

4 years agoConfigure backing device max_ratio for FUSE filesystems.
Martijn Coenen [Mon, 29 Jun 2020 09:53:34 +0000 (11:53 +0200)]
Configure backing device max_ratio for FUSE filesystems.

By default FUSE filesystems have a max_ratio of 1%, meaning only 1% of
dirty pages on the system can belong to a FUSE filesystem before we
start writing back pages (and throttling, if writeback can't keep up).
This limit is useful for untrusted filesystems, but in our case, we
trust the FUSE filesystem. Since FUSE writes result in writes to the
lower filesystem, FUSE should take at most 50%. Let's start with
changing max_ratio to 40%, to avoid needless throttling.

Bug: 159254170
Bug: 159770752
Test: inspect /sys/class/bdi manually after boot
Change-Id: I467e3770fc4afba0a08fa480c0b86aa054c8b875

4 years agoUnmount public volume if FUSE mount fails am: f71707916f
Zim [Mon, 22 Jun 2020 16:53:26 +0000 (16:53 +0000)]
Unmount public volume if FUSE mount fails am: f71707916f

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11900947

Change-Id: Ie390d39ede3dbd63012b0c5acdbcac57e0143145

4 years agoUnmount public volume if FUSE mount fails
Zim [Wed, 17 Jun 2020 13:56:10 +0000 (14:56 +0100)]
Unmount public volume if FUSE mount fails

Sometimes, during early boot, a public volume may be created before
the user is unlocked and the mount may fail. This mount failure does
not revert the lower fs mounts (sdcardfs and vfat). Subsequent
mount attempts will then fail because we'd attempt to mount vfat on
already mounted /mnt/media_rw/<volname>

Bug: 158489548
Test: Resilient to an artificial sleep in
StorageManagerService#completeUnlockUser to
delay user unlock longer than public volume mount

Change-Id: I9a1574596434a2eb6b2553c0c9220c2118c7e4fd

4 years ago[automerger skipped] Merge "Add an isCheckpointing() binder call for adb remount...
David Anderson [Fri, 19 Jun 2020 20:21:48 +0000 (20:21 +0000)]
[automerger skipped] Merge "Add an isCheckpointing() binder call for adb remount." into rvc-dev am: f87198e025 -s ours

am skip reason: Change-Id I33a691da3b99343acfc1e8ddf68a14504c3bfbe1 with SHA-1 23850d30f6 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11917729

Change-Id: I324e156e155f361491f963518f69a956ac23dd7f

4 years agoMerge "Add an isCheckpointing() binder call for adb remount." into rvc-dev
David Anderson [Fri, 19 Jun 2020 20:04:54 +0000 (20:04 +0000)]
Merge "Add an isCheckpointing() binder call for adb remount." into rvc-dev

4 years agoAdd an isCheckpointing() binder call for adb remount.
David Anderson [Thu, 11 Jun 2020 06:51:17 +0000 (23:51 -0700)]
Add an isCheckpointing() binder call for adb remount.

This is needed so "adb remount" can avoid writing to /data during a
checkpoint.

Bug: 157540389
Test: manual test
Change-Id: I33a691da3b99343acfc1e8ddf68a14504c3bfbe1
Merged-In: I33a691da3b99343acfc1e8ddf68a14504c3bfbe1

4 years ago[automerger skipped] Merge "Don't call block checkpoint functions above dm-default...
TreeHugger Robot [Thu, 18 Jun 2020 22:36:16 +0000 (22:36 +0000)]
[automerger skipped] Merge "Don't call block checkpoint functions above dm-default-key" into rvc-dev am: 14d4e7c7df -s ours

am skip reason: Change-Id Ic15fadc67d306463dd0b554f679306d8f9081451 with SHA-1 3fe931109c is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11886461

Change-Id: I4559e77b9ea60cf49f4824dc93a6a6141b9fb94b

4 years agoMerge "Don't call block checkpoint functions above dm-default-key" into rvc-dev
TreeHugger Robot [Thu, 18 Jun 2020 22:22:58 +0000 (22:22 +0000)]
Merge "Don't call block checkpoint functions above dm-default-key" into rvc-dev

4 years agoMerge "Don't call block checkpoint functions above dm-default-key" am: 1bb7e8a928...
Paul Lawrence [Thu, 18 Jun 2020 22:16:14 +0000 (22:16 +0000)]
Merge "Don't call block checkpoint functions above dm-default-key" am: 1bb7e8a928 am: 53f1d07339

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1330879

Change-Id: I54fdd3098c52dcb53cee0956f4dd1e43e09f5800

4 years agoMerge "Add an isCheckpointing() binder call for adb remount." am: b50480bb96 am:...
David Anderson [Thu, 18 Jun 2020 22:15:56 +0000 (22:15 +0000)]
Merge "Add an isCheckpointing() binder call for adb remount." am: b50480bb96 am: 60e41b7084

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1330854

Change-Id: I0aa0536cfd33f189525115efa07e49930f53b79a

4 years agoMerge "Don't call block checkpoint functions above dm-default-key" am: 1bb7e8a928
Paul Lawrence [Thu, 18 Jun 2020 22:00:47 +0000 (22:00 +0000)]
Merge "Don't call block checkpoint functions above dm-default-key" am: 1bb7e8a928

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1330879

Change-Id: Ifa48af749baa5d50c7459dbb5bda1573d847b622

4 years agoMerge "Add an isCheckpointing() binder call for adb remount." am: b50480bb96
David Anderson [Thu, 18 Jun 2020 22:00:37 +0000 (22:00 +0000)]
Merge "Add an isCheckpointing() binder call for adb remount." am: b50480bb96

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1330854

Change-Id: I14674da2b3cf86c09179b94e28e76fec30378e12

4 years agoDon't call block checkpoint functions above dm-default-key
Paul Lawrence [Fri, 12 Jun 2020 15:12:48 +0000 (08:12 -0700)]
Don't call block checkpoint functions above dm-default-key

Bug: 156225476
Test: Build for f2fs and ext4 device, make sure checkpoints roll back
and commit

Merged-In: Ic15fadc67d306463dd0b554f679306d8f9081451
Change-Id: Ic15fadc67d306463dd0b554f679306d8f9081451

4 years agoMerge "Don't call block checkpoint functions above dm-default-key"
Paul Lawrence [Thu, 18 Jun 2020 21:56:10 +0000 (21:56 +0000)]
Merge "Don't call block checkpoint functions above dm-default-key"

4 years agoMerge "Add an isCheckpointing() binder call for adb remount."
David Anderson [Thu, 18 Jun 2020 21:45:21 +0000 (21:45 +0000)]
Merge "Add an isCheckpointing() binder call for adb remount."

4 years agoMerge "Configure read ahead for fuse mounts" into rvc-dev am: bcd7d5e7ce
Nikita Ioffe [Wed, 17 Jun 2020 16:53:30 +0000 (16:53 +0000)]
Merge "Configure read ahead for fuse mounts" into rvc-dev am: bcd7d5e7ce

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11837171

Change-Id: I90e3ab660ddb356bd7c0212e188b997f6bfa07d4

4 years agoMerge "Configure read ahead for fuse mounts" into rvc-dev
Nikita Ioffe [Wed, 17 Jun 2020 16:37:37 +0000 (16:37 +0000)]
Merge "Configure read ahead for fuse mounts" into rvc-dev

4 years agoConfigure read ahead for fuse mounts
Nikita Ioffe [Fri, 12 Jun 2020 11:59:45 +0000 (12:59 +0100)]
Configure read ahead for fuse mounts

For fuse read ahead can be configured by writing a value to the
/sys/class/bdi/{MAJOR}:{MINOR}/read_ahead_kb file.

There are several different ways of getting {MAJOR}:{MINOR} values of
the filesystem:

* Look at st_dev of stat("/mnt/user/0/emulated").
* Parse /proc/self/mountinfo.

Stat'ing approach is used since it's easier to implement.

Bug: 157982297
Test: atest vold_tests
Test: adb shell cat /proc/self/mountinfo to get MAJOR:MINOR
Test: adb shell cat /sys/class/bdi/{MAJOR}:{MINOR}/read_ahead_kb
Test: created public volume, checked it's read_ahead_kb is also 256
Change-Id: Id0c149c4af1ceabf3afc33b4100563a512b38316

4 years agoAdd app's own UID to the default ACL. am: 1129b81071
Martijn Coenen [Wed, 17 Jun 2020 07:01:58 +0000 (07:01 +0000)]
Add app's own UID to the default ACL. am: 1129b81071

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11871333

Change-Id: Icbff1ee04a5f79582e92d5fa8ed8913260cc417f

4 years agoAdd app's own UID to the default ACL.
Martijn Coenen [Tue, 16 Jun 2020 12:58:52 +0000 (14:58 +0200)]
Add app's own UID to the default ACL.

On devices without sdcardfs, /Android/data/com.foo and
/Android/obb/com.foo can be written by other processes (eg installers);
in those cases, file ownership may be wrong. To ensure that the original
app always has access to the files contained in this directory, add a
group to the default ACL that matches the UID of the app. Since all apps
have their own UID also as their group ID, this ensures that things keep
working correctly.

Bug: 157530951
Test: atest
android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageUnsharedObb
Change-Id: I829a2a7c7b578a8328643f38681e68796adcd6b2

Change-Id: Ibbc333fb395507363830dfcf5dc6f1cfd55f008d

4 years agoDon't call block checkpoint functions above dm-default-key
Paul Lawrence [Fri, 12 Jun 2020 15:12:48 +0000 (08:12 -0700)]
Don't call block checkpoint functions above dm-default-key

Bug: 156225476
Test: Build for f2fs and ext4 device, make sure checkpoints roll back
and commit

Change-Id: Ic15fadc67d306463dd0b554f679306d8f9081451

4 years agoAdd an isCheckpointing() binder call for adb remount.
David Anderson [Thu, 11 Jun 2020 06:51:17 +0000 (23:51 -0700)]
Add an isCheckpointing() binder call for adb remount.

This is needed so "adb remount" can avoid writing to /data during a
checkpoint.

Bug: 157540389
Test: manual test
Change-Id: I33a691da3b99343acfc1e8ddf68a14504c3bfbe1

4 years ago[automerger skipped] Merge "Record use of metadata encryption in property" am: f20a16...
Treehugger Robot [Tue, 2 Jun 2020 19:33:43 +0000 (19:33 +0000)]
[automerger skipped] Merge "Record use of metadata encryption in property" am: f20a16575f am: d49f8c9eb7 -s ours

am skip reason: Change-Id I400873ec207cb63f0407fefc83962bb3a927e294 with SHA-1 94abae03a9 is in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1322598

Change-Id: Idf38f57a2370789e069846b6dc3e4b36cb80d9e4

4 years agoMerge "Record use of metadata encryption in property" am: f20a16575f
Treehugger Robot [Tue, 2 Jun 2020 19:20:44 +0000 (19:20 +0000)]
Merge "Record use of metadata encryption in property" am: f20a16575f

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1322598

Change-Id: I7b102707853ea2556c5a24858ae43ea5c2717616

4 years agoMerge "Record use of metadata encryption in property"
Treehugger Robot [Tue, 2 Jun 2020 19:04:12 +0000 (19:04 +0000)]
Merge "Record use of metadata encryption in property"

4 years agoRecord use of metadata encryption in property
Paul Crowley [Mon, 23 Mar 2020 15:59:12 +0000 (08:59 -0700)]
Record use of metadata encryption in property

Bug: 152150018
Test: Cuttlefish with and without keydirectory option
Cherry-Picked-From: 94abae03a97bf67bc2cd04b6a74e07ed08bf30a0
Merged-In: I400873ec207cb63f0407fefc83962bb3a927e294
Change-Id: I400873ec207cb63f0407fefc83962bb3a927e294

4 years agoMerge "vold: Support aborting FUSE connections." into rvc-dev am: cbb69e548a
Martijn Coenen [Fri, 29 May 2020 16:00:05 +0000 (16:00 +0000)]
Merge "vold: Support aborting FUSE connections." into rvc-dev am: cbb69e548a

Change-Id: I9f3435a686e76f9fbc8b8ec8cae33f5538a94ec5

4 years agoMerge "vold: Support aborting FUSE connections." into rvc-dev
Martijn Coenen [Fri, 29 May 2020 15:47:05 +0000 (15:47 +0000)]
Merge "vold: Support aborting FUSE connections." into rvc-dev

4 years agoFuseDaemonHostTest is migrated to CTS and renamed. am: de83802e41
Abhijeet Kaur [Fri, 29 May 2020 15:07:04 +0000 (15:07 +0000)]
FuseDaemonHostTest is migrated to CTS and renamed. am: de83802e41

Change-Id: I1e26192d3ae181bc3fd9bcb3f7bf56db0f073328

4 years agoFuseDaemonHostTest is migrated to CTS and renamed.
Abhijeet Kaur [Thu, 28 May 2020 17:12:40 +0000 (18:12 +0100)]
FuseDaemonHostTest is migrated to CTS and renamed.

FuseDaemonHostTest is migrated to CTS and renamed to
CtsScopedStorageHostTest.

Bug: 142926859
Test: atest --test-mapping
Change-Id: I24c74e20909ccf8868d1487e1cc93f6f2c0108fc

4 years agovold: Support aborting FUSE connections.
Martijn Coenen [Wed, 29 Apr 2020 05:49:41 +0000 (07:49 +0200)]
vold: Support aborting FUSE connections.

This can be done through binder as well as vdc, using 'vdc volume
abort_fuse'.

Bug: 153411204
Test: adb shell vdc volume abort_fuse
Change-Id: I93e46dc1cd361729cc1162c63520cf73152ea409

4 years agoMove enabling sdcardfs behind a property am: f36bdddc7e
Daniel Rosenberg [Thu, 21 May 2020 08:41:14 +0000 (08:41 +0000)]
Move enabling sdcardfs behind a property am: f36bdddc7e

Change-Id: I8bf90ef649975d182787757d73f9e2b46389483f

4 years ago[automerger skipped] Merge "Handle virtio in private fs mapping" am: e471d11d46 am...
Treehugger Robot [Wed, 20 May 2020 07:26:02 +0000 (07:26 +0000)]
[automerger skipped] Merge "Handle virtio in private fs mapping" am: e471d11d46 am: d625abfda2 -s ours

am skip reason: Change-Id I0b41670d5f76b2506dad437917c2276f8e0aaccf with SHA-1 c671731075 is in history

Change-Id: Id73de89d4b905212935da4286ee50789b47695e6

4 years agoMerge "Handle virtio in private fs mapping" am: e471d11d46
Treehugger Robot [Wed, 20 May 2020 07:08:04 +0000 (07:08 +0000)]
Merge "Handle virtio in private fs mapping" am: e471d11d46

Change-Id: If088b875ff4cbca66fe9c6f9224b437edc85dae8

4 years agoMerge "Handle virtio in private fs mapping"
Treehugger Robot [Wed, 20 May 2020 06:32:43 +0000 (06:32 +0000)]
Merge "Handle virtio in private fs mapping"

4 years agoMove enabling sdcardfs behind a property
Daniel Rosenberg [Tue, 12 May 2020 05:58:42 +0000 (22:58 -0700)]
Move enabling sdcardfs behind a property

This allows devices that have sdcardfs enabled in the kernel to not use
it. When external_storage.sdcardfs.enabled=0, sdcardfs will not be
mounted. This is treated as default true to not affect upgrading
devices. It does not use the old ro.sys.sdcardfs as that has been
repurposed over time and no longer can be relied on to turn off
sdcardfs. This is included within emulated_storage.mk

Bug: 155222498
Test: mount|grep "type sdcardfs" should find nothing after boot complete
      if external_storage.sdcardfs.enabled=0
Change-Id: I23d75fb1225aeabbcb1a035ad62fd042b6b3c7b5

4 years agoMerge "Handle virtio in private fs mapping" into rvc-dev am: 0d1fcb90d6
TreeHugger Robot [Wed, 20 May 2020 04:44:06 +0000 (04:44 +0000)]
Merge "Handle virtio in private fs mapping" into rvc-dev am: 0d1fcb90d6

Change-Id: Idfa020f7211187ddc9c530482de9a53d14ef315a

4 years agoMerge "Handle virtio in private fs mapping" into rvc-dev
TreeHugger Robot [Wed, 20 May 2020 04:28:31 +0000 (04:28 +0000)]
Merge "Handle virtio in private fs mapping" into rvc-dev

4 years agoHandle virtio in private fs mapping
Alistair Delva [Tue, 19 May 2020 22:49:26 +0000 (15:49 -0700)]
Handle virtio in private fs mapping

When the vold core decides if a device is SD or USB, it checks for MMC
or virtio, however when the filesystem type is decided, it does not
check for virtio, only MMC. This causes virtio SD cards to be formatted
with ext4 unconditionally.

This fix is independently correct, but it incidentally gets adopted
storage working on cuttlefish (and Android Emulator) because f2fs can
support fscrypt and casefolding at the same time; ext4 currently cannot.

Bug: 156286088
Change-Id: I0b41670d5f76b2506dad437917c2276f8e0aaccf
Merged-In: I0b41670d5f76b2506dad437917c2276f8e0aaccf

4 years agoHandle virtio in private fs mapping
Alistair Delva [Tue, 19 May 2020 22:49:26 +0000 (15:49 -0700)]
Handle virtio in private fs mapping

When the vold core decides if a device is SD or USB, it checks for MMC
or virtio, however when the filesystem type is decided, it does not
check for virtio, only MMC. This causes virtio SD cards to be formatted
with ext4 unconditionally.

This fix is independently correct, but it incidentally gets adopted
storage working on cuttlefish (and Android Emulator) because f2fs can
support fscrypt and casefolding at the same time; ext4 currently cannot.

Bug: 156286088
Change-Id: I0b41670d5f76b2506dad437917c2276f8e0aaccf

4 years agoMerge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a
Paul Crowley [Tue, 19 May 2020 23:12:25 +0000 (23:12 +0000)]
Merge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a

Change-Id: I2e39a3e24ea8bf488ffb8e901fa6449175673b5c

4 years agoMerge "Record use of metadata encryption in property" into rvc-dev
Paul Crowley [Tue, 19 May 2020 22:59:13 +0000 (22:59 +0000)]
Merge "Record use of metadata encryption in property" into rvc-dev

4 years ago[automerger skipped] Merge "Expand virtio_block check to other virtual devices" am...
Treehugger Robot [Sat, 16 May 2020 05:27:30 +0000 (05:27 +0000)]
[automerger skipped] Merge "Expand virtio_block check to other virtual devices" am: ff9975c04f am: edb596fc36 -s ours

am skip reason: Change-Id Ieae805d08fddd0124a397636f04d99194a9ef7e5 with SHA-1 ff1fc9bc41 is in history

Change-Id: I8e4c5e3a044f8305dd29820709e073687991e559

4 years agoMerge "Expand virtio_block check to other virtual devices" am: ff9975c04f
Treehugger Robot [Sat, 16 May 2020 05:13:11 +0000 (05:13 +0000)]
Merge "Expand virtio_block check to other virtual devices" am: ff9975c04f

Change-Id: Ic604273ddef8ac356e1e23fba050da7d68a24871

4 years agoMerge "Expand virtio_block check to other virtual devices"
Treehugger Robot [Sat, 16 May 2020 04:51:28 +0000 (04:51 +0000)]
Merge "Expand virtio_block check to other virtual devices"

4 years agoExpand virtio_block check to other virtual devices am: ff1fc9bc41
Alistair Delva [Sat, 16 May 2020 01:48:06 +0000 (01:48 +0000)]
Expand virtio_block check to other virtual devices am: ff1fc9bc41

Change-Id: I679b9ab19d470a14e2708afd9078f2cff599b3b6