Commit graph

3463 commits

Author SHA1 Message Date
Nikita Ioffe
f850e6e564 Allow fscrypt_mount_metadata_encrypted to be called more than once
In case of userspace reboot, this function will be called again to
remount userdata into checkpoint mode.

Test: adb shell setprop sys.init.userdata_remount.force_umount_f2fs 1
Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb reboot userspace
Test: adb shell dumpsys activity
Bug: 135984674
Bug: 143970043
Change-Id: I300b1960a6c4e95b13c43d806c4f3a9e4a612ac4
2019-12-09 21:19:11 +00:00
Martijn Coenen
90d2652438 Merge "Get rid of confusing FUSE variables and comments." 2019-12-09 18:39:49 +00:00
Martijn Coenen
adcc845231 Get rid of confusing FUSE variables and comments.
Long before scoped storage, FUSE was used to create several views of the
filesystem; this was later replaced by sdcardfs, yet the code still
references FUSE in variables and log messages. Fix those up to avoid
confusion with the "new FUSE".

Bug: 135341433
Test: atest AdoptableHostTest
Change-Id: I2966c5f95d6f38df36a20cdfdd0b95b3051f3f1e
2019-12-09 16:52:15 +01:00
Songchun Fan
0583015a57 Merge "[incremental] use vold to mount/unmount IncrementalFileSystem" am: 6bdfb77d8b am: a0945f468a
am: 1119bc8531

Change-Id: I772667d5c43cdf1ff37b156db9f47b61820433c7
2019-12-06 01:16:26 -08:00
Songchun Fan
1119bc8531 Merge "[incremental] use vold to mount/unmount IncrementalFileSystem" am: 6bdfb77d8b
am: a0945f468a

Change-Id: I4244844cde78dc46cac88299fa1fd2e2eee9af26
2019-12-06 00:05:07 -08:00
Songchun Fan
a0945f468a Merge "[incremental] use vold to mount/unmount IncrementalFileSystem"
am: 6bdfb77d8b

Change-Id: Ic9abd7f6e502e9f051effa998e3fbd40746d57d7
2019-12-06 00:03:15 -08:00
Songchun Fan
6bdfb77d8b Merge "[incremental] use vold to mount/unmount IncrementalFileSystem" 2019-12-06 06:45:37 +00:00
Songchun Fan
ab55cecdc1 [incremental] use vold to mount/unmount IncrementalFileSystem
Let vold mount IncFs onto directories under data and open control files.

Test: builds
Change-Id: Ibd96aae254b4fefaf56c9d549c4672a987c46221
2019-12-04 14:01:22 -08:00
Automerger Merge Worker
72edc7fa35 Merge "Add '/system/bin/vdc volume reset' command" am: d21a8a495d am: 961806fdc9
Change-Id: Ib62cb7e0a63e9a3f182631f1ac3ee108607b95d1
2019-12-04 20:38:58 +00:00
Nikita Ioffe
961806fdc9 Merge "Add '/system/bin/vdc volume reset' command" am: d21a8a495d
am: 86bad28329

Change-Id: I589bc0973050eea50147f927cf2044949ca4d7e0
2019-12-04 12:18:28 -08:00
Nikita Ioffe
86bad28329 Merge "Add '/system/bin/vdc volume reset' command"
am: d21a8a495d

Change-Id: I21fde79cd170bdfcd8a32b8a85da56099a223e2d
2019-12-04 11:52:20 -08:00
Nikita Ioffe
d21a8a495d Merge "Add '/system/bin/vdc volume reset' command" 2019-12-04 19:22:50 +00:00
Martijn Coenen
10b122b4e9 Don't LOG() after fork() and before exec().
LOG() can hang, because another vold thread may have been holding
a libc lock at the time we forked. Simply moving the log line to
before the fork().

Bug: 135341433
Test: atest AdoptableHostTest
Change-Id: I6063eb33f35c835a226bc1e56de97ace426747ff
2019-12-04 15:50:29 +01:00
Oli Lan
ac003c4955 Create directories for snapshots of DE_n and CE_n apex data.
This creates apexrollback directories under /data/misc_[de|ce]/<user>
which will hold snapshots of DE_n and CE_n apex data directories
(i.e. it will hold backups of data from /data/misc_[de|ce]/<user>/apexdata
for particular apexes).

See go/apex-data-directories for details.

Bug: 141148175
Test: Built and flashed, checked directory was created.
Change-Id: I468060b20dee0c50033b5f014ce8716582d5e6bc
2019-12-04 10:29:50 +00:00
Nikita Ioffe
7596581e9f Add '/system/bin/vdc volume reset' command
It will be used during the userspace reboot to unmount all emulated
storages, which is a prerequisite to unmount+remount ext4 userdata into
checkpoint mode.

Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb reboot userspace
Bug: 143970043
Bug: 135984674
Change-Id: I07491bc4be2f30debe21b764766c9def68548e16
2019-12-02 11:51:20 +00:00
TreeHugger Robot
7e170b919e Merge "VolumeManager: limit the scope of remountUid post fork." 2019-11-28 10:18:08 +00:00
TreeHugger Robot
8b4b452c80 Merge "Allow null IVoldMountCallback in Vold#mount" 2019-11-27 19:22:29 +00:00
Zim
9d1425c09b Allow null IVoldMountCallback in Vold#mount
Test: m
Bug: 145231499
Change-Id: I51cb4424d821078a3604d5b3a42e99d3aaf658c3
2019-11-27 18:16:25 +00:00
Narayan Kamath
02efdf55d2 VolumeManager: limit the scope of remountUid post fork.
We want to be sure we're not allocating memory, holding locks
or otherwise preventing the child process from making progress.

This is a temporary fix of limited scope. In the medium term, it
would be preferable to exec a binary that performs this work for us
as soon as we fork.

Test: manual
Bug: 141678467

Change-Id: I57dbd9b3c887aa27e2dd609abf0ad43c66f4ef2a
2019-11-27 12:48:35 +00:00
TreeHugger Robot
fe83792eec Merge "Don't automatically start user 0." 2019-11-25 15:24:56 +00:00
Martijn Coenen
c659b0a8bf Merge "Add mount callback" 2019-11-25 13:00:54 +00:00
Martijn Coenen
54bf4c03d1 Don't automatically start user 0.
It's the responsibility of the StorageManagerService to send down
started users after a reset(); and with the latest multi-user FUSE
changes, the manual start is no longer necessary.

Bug: 135341433
Test: atest AdoptableHostTest

Change-Id: I3c9c1d7c25ad10787212d7902fa3f1878ee5f896
2019-11-22 17:06:07 +01:00
Zim
5048b4b2bc Add mount callback
Mounting a FUSE path needs two steps:
1. Mounting the filesystem
2. Starting the FUSE session in the FUSE daemon

The second part requires retriving an fd from (1) and the mount paths
and passing it to the FUSE daemon.

Previously, we'd return from the Vold mount call and mark the volume
as mounted while we scramble to do (2). This means there's a time
period where the Volume is marked as MOUNTED but not actually ready
and any IO access on the paths will hang forever. This could also be
misleading when interpreting bug reports.

Now, we block the Vold mount call until the FUSE session is started

Test: atest AdoptableHostTest
Bug: 144275217

Change-Id: I45238a31df71286f67ef1c65c711d0085d72e97f
2019-11-22 17:06:04 +01:00
Oli Lan
94457217cb Create DE_n and CE_n APEX data directories.
This creates an apexdata directory under /data/misc_de/<user> and
/data/misc_ce/<user>, and also creates a directory under that for
every APEX that is installed.

See go/apex-data-directories.

APEXes are discovered by scanning the /apex directory. It may be better
to delegate this process to a library, but it is proposed to defer that
change to a future CL.

Bug: 141148175
Test: Built and flashed, checked directories were created.
Change-Id: I95a060b4f42241c91da25a779e61a8f85ca1914c
2019-11-21 14:07:18 +00:00
Janis Danisevskis
2466ef7671 Merge "Removed obsolete Test" am: 6e3441a8ea am: 9f5f518c19
am: ffe6756d10

Change-Id: I514c9bd97c6aca3020687941e695db4e3f134e92
2019-11-18 16:37:15 -08:00
Janis Danisevskis
ffe6756d10 Merge "Removed obsolete Test" am: 6e3441a8ea
am: 9f5f518c19

Change-Id: I39bccf96f352b1000f2fdd64ffff92e20bbfc340
2019-11-18 16:28:28 -08:00
Janis Danisevskis
9f5f518c19 Merge "Removed obsolete Test"
am: 6e3441a8ea

Change-Id: I392f1737c5dfa6e7aee78c7b1af1b016f6f102e9
2019-11-18 16:22:14 -08:00
Treehugger Robot
6e3441a8ea Merge "Removed obsolete Test" 2019-11-19 00:11:11 +00:00
Janis Danisevskis
8c4eb2c2c0 Removed obsolete Test
The HidlizationEquivalenceTest was used to make sure the same key is
computed by the scrypt algorithm regardless of whether the old
(<= KM2 HAL pre treble) or the new (>= KM3.0 treble) HAL was used.
Since the treble is now the default, and old HAL don't even exist on
new devices, we should call the migration a success and drop this test
altogether.

Test: Removed obsolete Code
Bug: 68197448
Change-Id: If10c79bafac4d0c8268675cbb8e1c4b46974aab5
2019-11-18 22:53:30 +00:00
TreeHugger Robot
d88f536a5a Merge "Fix wrong symlink terminology" 2019-11-18 12:49:16 +00:00
Tianjie Xu
09de0ff8d6 Clear the warm_reset flag after boot is successful
The property is set to inform kernel to do a warm_reset on the next
reboot. This is useful to persist the logs to debug device boot
failures. After the slot has been marked as boot successful, we can drop
the warm_reset flag to avoid the performance overhead on the next
reboot.

Bug: 143489994
Test: check the property is set to 0 by vold
Change-Id: If7c922f40bcf9a6f7894af0a334ab23d88d40d17
2019-11-15 14:06:02 -08:00
Zimuzo Ezeozue
9da067b08b Merge "Add zezeozue to OWNERS" am: f9972055f5 am: e8db702702
am: b287ea6a02

Change-Id: I325fa3adab62d11c228be5b79c75f1cd9034453a
2019-11-15 08:39:38 -08:00
Zimuzo Ezeozue
b287ea6a02 Merge "Add zezeozue to OWNERS" am: f9972055f5
am: e8db702702

Change-Id: I0b6a7b06d1ce39e8e70e87a14b312425c55828d5
2019-11-15 08:32:59 -08:00
Zimuzo Ezeozue
e8db702702 Merge "Add zezeozue to OWNERS"
am: f9972055f5

Change-Id: I45c211d810f1a15e0b5a1f4decc33a0eece8dafd
2019-11-15 08:25:56 -08:00
Zimuzo Ezeozue
f9972055f5 Merge "Add zezeozue to OWNERS" 2019-11-15 16:06:59 +00:00
Zim
076967a823 Add zezeozue to OWNERS
Test: n/a
Change-Id: I75339fcea5d4e537c6312e8e515b6dd62d7ae7fc
2019-11-15 16:03:47 +00:00
Zim
e5393d437c Fix wrong symlink terminology
symlink(2) creates a symbolic link 'linkpath' containing a
string 'target'.

linkpath was misnamed as target in MountUserFuse. This cl
s/target/linkpath/ in Utils#MountUserFuse.

Test: m
Change-Id: I274823da16b87ffc124e2e8c4563b1d16546a6e7
2019-11-15 11:44:12 +00:00
Zim
2d45d9b420 Fix emulated volumes not created for secondary users
Ifabaa12368e5a591fbcdce4ee71c83ff35fdac6b introduced individual
emulated volumes for each Android user. The change however didn't
create the volumes for the secondary users on user start in vold
without the persist.sys.fuse flag

Now we always create the volumes but only mount sdcardfs volumes
for user 0 because the sdcardfs mount paths do not change with for
different users unlike the FUSE mount paths.

Bug: 144473552
Test: atest AdoptableHostTest
Test: Start a guest user in Settings and launch chrome browser in that
user, verify that chrome does not crash

Change-Id: I89f3591d0197d86267f0e3934f496273e2f9fd7e
2019-11-14 16:28:33 +00:00
Zim
a438b24368 Fix multi-user and multi-storage with FUSE
Up until now, the FUSE mount logic has made two assumptions:
1. The primary external volume is an emulated volume on /data/media
2. Only the primary user is running, as user zero

These assumptions are fixed by the following changes
creating an EmulatedVolume per Android user and changing the
VolumeBase id format to append the user to the id, so
s/emulated/emulated-0/. This allows us mount separate volumes per user

Some additional refactorings to re-use/clean up code.

Test: adb shell sm set-virtual-disk and partition disk operations work
even after setting up a work profile
Bug: 135341433

Change-Id: Ifabaa12368e5a591fbcdce4ee71c83ff35fdac6b
2019-11-11 20:24:49 +00:00
shaozhongqi
0ddfc941b8 Merge "Exfat Need to add automatic repair function when exfat fsck device" am: 7e249ebdae am: 8006c80960
am: 42726be6a3

Change-Id: Ic8f3d783087dde9550230e36749eab49b30d9fdc
2019-11-08 15:26:27 -08:00
shaozhongqi
42726be6a3 Merge "Exfat Need to add automatic repair function when exfat fsck device" am: 7e249ebdae
am: 8006c80960

Change-Id: I74cdf0596642b2db70f4507eefc8acd68ad1fe26
2019-11-08 15:22:25 -08:00
shaozhongqi
8006c80960 Merge "Exfat Need to add automatic repair function when exfat fsck device"
am: 7e249ebdae

Change-Id: I835a8717fb25b651ce815c9912322b84e9d66041
2019-11-08 15:18:28 -08:00
Treehugger Robot
7e249ebdae Merge "Exfat Need to add automatic repair function when exfat fsck device" 2019-11-08 22:43:45 +00:00
shaozhongqi
081cf8efdb Exfat Need to add automatic repair function when exfat fsck device
bug:143229109

Test: Manual

Change-Id: Ibf650bdcb378dd9c07f904bdd18b36f376b45b61
Signed-off-by: shaozhongqi <shaozhongqi@xiaomi.com>
2019-10-31 06:37:50 +00:00
Paul Crowley
7ee93a66bb Merge "Remove libfscrypt now it's in libfs_mgr" am: 43f8298bdd am: ce187e7fd6
am: ff5ad94627

Change-Id: Ibeaec1d3fd09893706cd927ff715f5f76d516749
2019-10-30 20:44:43 -07:00
Paul Crowley
ff5ad94627 Merge "Remove libfscrypt now it's in libfs_mgr" am: 43f8298bdd
am: ce187e7fd6

Change-Id: I67dab6b461cf9eebc91db8d922c100b786597f1d
2019-10-30 20:38:26 -07:00
Paul Crowley
ce187e7fd6 Merge "Remove libfscrypt now it's in libfs_mgr"
am: 43f8298bdd

Change-Id: I0eaafaa461fa2ec6153a3e3bf49926b2efc610b7
2019-10-30 20:31:55 -07:00
Paul Crowley
43f8298bdd Merge "Remove libfscrypt now it's in libfs_mgr" 2019-10-31 03:17:23 +00:00
Xin Li
6682f3ee33 [automerger skipped] DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master am: b89717b9c3
am: ac868f7b3c -s ours
am skip reason: subject contains skip directive

Change-Id: I2376db748a97dadabd502ee27ff5318586d054a8
2019-10-30 16:28:18 -07:00
Xin Li
ac868f7b3c DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
am: b89717b9c3

Change-Id: Ibaa7773225c1fa7b64bce5d23dc46afae27ffee4
2019-10-30 15:58:18 -07:00