Commit graph

2535 commits

Author SHA1 Message Date
Daniel Rosenberg
de841f6d89 Merge "Retry opening loop device"
am: c8f5cbb5b1

Change-Id: I5657465fe50f61e3c45e7d13eb5953ef7771d5fa
2019-04-02 14:23:59 -07:00
Daniel Rosenberg
c8f5cbb5b1 Merge "Retry opening loop device" 2019-04-02 20:28:44 +00:00
Daniel Rosenberg
4538cb20b9 Retry opening loop device
If more than the default number of loop devices is in use, we may need
to wait for the device path to be available.

Bug: 128873591
Bug: 122059364
Test: Set up adopted virtual disk and check that it loads on boot
Change-Id: I201dcc32043664076f50b0d6f40de6e5e1a65342
2019-04-01 17:37:47 -07:00
Jaegeuk Kim
a970ff8448 Merge "idle-maint: don't need to change discard_granularity"
am: 444a24558d

Change-Id: If0679363fb8563dedb43f8bd6266c74e4869d44f
2019-04-01 07:13:28 -07:00
Jaegeuk Kim
444a24558d Merge "idle-maint: don't need to change discard_granularity" 2019-04-01 14:04:24 +00:00
Nick Kralevich
874b841223 Merge "vold: add android-* to tidy_checks"
am: 1820b9b3b9

Change-Id: I5b1c6926f050df8b24ee3d52b93080dab0745571
2019-03-29 18:38:21 -07:00
Nick Kralevich
5af0c75525 Merge "vold: cleanups for O_CLOEXEC tidy checks."
am: a59868d6de

Change-Id: Ice4a6009beb2d41d381e461b00be93471b100778
2019-03-29 18:38:04 -07:00
Nick Kralevich
1820b9b3b9 Merge "vold: add android-* to tidy_checks" 2019-03-30 01:27:57 +00:00
Nick Kralevich
a59868d6de Merge "vold: cleanups for O_CLOEXEC tidy checks." 2019-03-30 01:27:38 +00:00
Paul Lawrence
e2d9258979 Merge "Fix checkpoint on Taimen"
am: 3889f17ad1

Change-Id: I06af82f6534b26e595be3aa1d39588175920d0db
2019-03-29 17:16:19 -07:00
Treehugger Robot
3889f17ad1 Merge "Fix checkpoint on Taimen" 2019-03-29 23:09:52 +00:00
Nick Kralevich
d78fb53378 vold: add android-* to tidy_checks
Bug: 129350825
Test: compiles and boots
Change-Id: If5a6267cc56bfc0ba73602bfa520035197b4fb90
2019-03-29 16:07:58 -07:00
Nick Kralevich
e7e89acbc8 vold: cleanups for O_CLOEXEC tidy checks.
Bug: 129350825
Test: compiles and boots
Change-Id: I83a484ca15df1b757b670008f15af5504bc94df1
2019-03-29 16:04:47 -07:00
Paul Lawrence
e81f4c1945 Fix checkpoint on Taimen
Bug: 129494872
Test: VtsKernelCheckpointTest runs and passes
Change-Id: Ib2de866db7c847d569789d1aa6cdbad7c3ee7ff4
2019-03-29 13:22:19 -07:00
Bernie Innocenti
3e9b69bf77 Merge "Fix bogus error checking on unique_fd"
am: 95587b085e

Change-Id: Ic11222fdc81a9a2e15546378f1bc5012107c50af
2019-03-28 21:09:18 -07:00
Treehugger Robot
95587b085e Merge "Fix bogus error checking on unique_fd" 2019-03-29 03:52:46 +00:00
Jaegeuk Kim
dc7162be6f idle-maint: don't need to change discard_granularity
F2FS changes proper configurations along with gc_urgent, so idle-maint doesn't
need to set this redundantly.

Change-Id: I4a71a5d877a3bb9636e2b65132ec806edc56a8fe
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2019-03-28 06:40:12 -07:00
Bernie Innocenti
ebe293ab54 Fix bogus error checking on unique_fd
The expression "!fd" calls the implicit conversion to int, but comparing
the raw fd against 0 does not work, since open() and other POSIX calls
returning a file descriptor use -1 to signal an error.

Test: m vold
Change-Id: I0847c276f39cb9dd09c7ffb96951276113418fc8
2019-03-28 15:54:52 +09:00
Daniel Rosenberg
e6db7e0a23 Merge "Switch Checkpoint health sleep time to ms."
am: 32a8a47b07

Change-Id: If927a879f06faac4fde97dde41f2017010f7001c
2019-03-26 19:45:51 -07:00
Daniel Rosenberg
32a8a47b07 Merge "Switch Checkpoint health sleep time to ms." 2019-03-27 02:34:24 +00:00
Daniel Rosenberg
23e15b78ad Merge "Fixed min_free_bytes prop name and usleep time default"
am: 7522da3036

Change-Id: I242863be8d2b0b9ff780670b340f8acbfdaad52e
2019-03-26 19:18:18 -07:00
Daniel Rosenberg
7522da3036 Merge "Fixed min_free_bytes prop name and usleep time default" 2019-03-27 02:01:48 +00:00
Suren Baghdasaryan
f1dec58b61 Merge "Convert ifstream usage into fopen() to prevent fd leaks into child processes"
am: 93fb6083d4

Change-Id: I28dc4717f22207e310c5701a78c04214ffa4d52a
2019-03-26 18:48:13 -07:00
Suren Baghdasaryan
93fb6083d4 Merge "Convert ifstream usage into fopen() to prevent fd leaks into child processes" 2019-03-27 01:31:15 +00:00
Daniel Rosenberg
b7dddd0a7e Switch Checkpoint health sleep time to ms.
This changes the property from microsecond to milliseconds, as we don't
need that sort of precision here. Also switches from using ulseep, which
has been removed from POSIX, to nanosleep.

Test: Builds, Boots, Times
Change-Id: Iefbaf8489ba05d8d688542fd7d4305efb980e701
2019-03-27 00:22:34 +00:00
Satoshi Futenma
18d10d4c15 Fixed min_free_bytes prop name and usleep time default
Test: check build

Bug: 129299864
Change-Id: Iab6a01d15185dd19604cd8d3d7ea4efc2b020e34
2019-03-27 00:12:39 +00:00
Suren Baghdasaryan
28af26ac47 Convert ifstream usage into fopen() to prevent fd leaks into child processes
std::ifstream does not use O_CLOEXEC flag when opening files. This leads
to file descriptors being inherited by child processes. In the case of vold
this results in leaking FDs to less privileged children with no permission
for these files which occasionally leads to SELinux denials.

Bug: 129298168
Change-Id: Id2731782a25d65c9a7cbf25dc441f3e7a17609c1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-26 20:10:24 +00:00
Rubin Xu
2c1e98d69f Merge "Remove excess logging in secdiscard"
am: b640f4e337

Change-Id: Ic4509611efc55b0953ccca02fd7730740982728a
2019-03-22 06:17:06 -07:00
Treehugger Robot
b640f4e337 Merge "Remove excess logging in secdiscard" 2019-03-22 13:05:35 +00:00
Daniel Rosenberg
5da6d2a0f9 Merge changes I977cc03b,I7b621476,Ib57f4461
am: 58551c0568

Change-Id: I0ecec87455c3c8daa53b00be941539998eea1cd2
2019-03-21 14:19:27 -07:00
Daniel Rosenberg
58551c0568 Merge changes I977cc03b,I7b621476,Ib57f4461
* changes:
  Add health check to checkpointing
  Change abortChanges to take a message and bool
  Make needsCheckpoint cover whole session
2019-03-21 21:01:08 +00:00
Daniel Rosenberg
8daeec05e8 Add health check to checkpointing
Take action if we are running out of checkpoint space.
Configurable via ro.sys properties.
ro.sys.cp_usleeptime = Time to sleep between checks
ro.sys.cp_min_free_bytes = Min free space to act on
ro.sys.cp_commit_on_full = action to take. Either commits or reboots to
                           continue attempt without checkpoint, or retry
			   and eventually abort OTA

Test: Trigger a checkpoint and fill the disk.
Bug: 119769392
Change-Id: I977cc03b7aef9320d661c8a0d716f8a1ef0be347
2019-03-21 13:33:49 -07:00
Daniel Rosenberg
a59e4396a4 Change abortChanges to take a message and bool
abortChanges will attempt to pass a reboot message, and will only reboot
if the device is currently checkpointing. Additionally, it can opt to
attempt to prevent future attempts. This only works for non-bootloader
controlled updates. Failures are ignored, as it will always reboot the
device. In the unlikely event of such a failure, the device will
continue to retry as though you did not ask to prevent future attempts.

Test: vdc checkpoint abortChanges abort_retry_test 1
      vdc checkpoint abortChanges abort_noretry_test 0

Change-Id: I7b6214765a1faaf4fd193c73331696b53ae572d2
2019-03-21 13:33:49 -07:00
Daniel Rosenberg
84203c1e24 Make needsCheckpoint cover whole session
This makes needCheckpoint return true when the device will or is using
checkpointing.

Test: vdc checkpoint startCheckpoint 1
      reboot
      vdc checkpoint needsCheckpoint
      should return 1 before and after data mounts, and 0 once the
      checkpoint has been committed

Change-Id: Ib57f4461d837f41a8110ed318168165a684d913a
2019-03-21 13:33:49 -07:00
Rubin Xu
f2e846f153 Remove excess logging in secdiscard
Remove all debug logs to reduce logspam a bit.

Bug: 64349233
Test: manual
Change-Id: I234fae7b9fb719b09af27985736f43f085dad301
2019-03-21 19:13:51 +00:00
Paul Crowley
04017039b7 Merge "Shell no longer globs, so glob in pushBackContents"
am: a41b7849d0

Change-Id: Iedd9a6d6834adc844e13e9ec596062032588fd53
2019-03-19 12:31:37 -07:00
Paul Crowley
a41b7849d0 Merge "Shell no longer globs, so glob in pushBackContents" 2019-03-19 19:13:56 +00:00
Paul Lawrence
4c5ce24e80 Merge "Add vdc checkpoint supportsBlockCheckpoint"
am: 860c731158

Change-Id: I61a7059649e8dc0ff5096f3494d5e4b0f8f3b787
2019-03-18 16:08:51 -07:00
Treehugger Robot
860c731158 Merge "Add vdc checkpoint supportsBlockCheckpoint" 2019-03-18 22:56:47 +00:00
Paul Lawrence
c5c79c5679 Add vdc checkpoint supportsBlockCheckpoint
Also add vdc checkpoint supportsFileCheckpoint
This is to allow tests to be specific to supported checkpoint mode.

Test: Built on Taimen and Crosshatch, made sure both new functions work
as expected

Change-Id: I0eab7453b13c0a2e31840ef9ad24a692cec55b00
2019-03-18 13:40:00 -07:00
Paul Crowley
51209e9e40 Shell no longer globs, so glob in pushBackContents
Bug: 113246065
Bug: 123057215

Test: As described in b/113246065 comment 1
Change-Id: Id766773ed4abe80a9fc1d5305f099aedfe8eed90
2019-03-18 10:26:47 -07:00
Chris Fries
3a38070bbf Merge "Fsync directories before delete key"
am: 7573874d3f

Change-Id: I568638b5de3c58d868024f959f890094eb1bd501
2019-03-14 08:34:06 -07:00
Chris Fries
7573874d3f Merge "Fsync directories before delete key" 2019-03-14 15:19:20 +00:00
Woody Lin
37c82f5c0f Fsync directories before delete key
The boot failure symptom is reproduced on Walleye devices. System boots
up after taking OTA and try to upgrade key, but keymaster returns "failed
to ugprade key". Device reboots to recovery mode because of the failure,
and finally trapped in bootloader screen. Possible scenario is:

(After taking OTA)
vold sends old key and op=UPGRADE to keymaster
keymaster creates and saves new key to RPMB, responses new key to vold
vold saves new key as temp key
vold renames temp key to main key -------------- (1) -- still in cache
vold sends old key and op=DELETE_KEY to keymaster
keymaster removes old key from RPMB ------------ (2) -- write directly to RPMB
==> SYSTEM INTERRUPTED BY CRASH OR SOMETHING; ALL CACHE LOST.
==> System boots up, key in RPMB is deleted but key in storage is old key.

Solution: A Fsync is required between (1) and (2) to cover this case.

Detail analysis: b/124279741#comment21

Bug: 112145641
Bug: 124279741
Test: Insert fault right after deleteKey in vold::begin (KeyStorage.cpp),
      original boot failure symptom is NOT reproducible.
Change-Id: Ib8c349d6d033f86b247f4b35b8354d97cf249d26
2019-03-14 16:48:32 +08:00
The Android Open Source Project
e1d82ea744 [automerger skipped] Merge "DO NOT MERGE - Skip PPRL.190305.001 into master"
am: 027fe9217c -s ours
am skip reason: subject contains skip directive

Change-Id: I2dc06015f2c873a8d9a62d743d97fc489937b644
2019-03-11 16:55:26 -07:00
The Android Open Source Project
1a158c67a0 [automerger skipped] DO NOT MERGE - Skip PPRL.190305.001 into master
am: 37c6ce4fb0 -s ours
am skip reason: subject contains skip directive

Change-Id: I6fa5c1108107e07e1d6c77592eaa6269672fdd2b
2019-03-11 16:54:31 -07:00
Treehugger Robot
027fe9217c Merge "DO NOT MERGE - Skip PPRL.190305.001 into master" 2019-03-11 23:16:31 +00:00
The Android Open Source Project
37c6ce4fb0 DO NOT MERGE - Skip PPRL.190305.001 into master
Bug: 127812889
Change-Id: I5bff7948e2fc254d0595329bd7a7262586de0c32
2019-03-11 14:57:55 -07:00
Jiyong Park
b5acb5bfba Merge "Don't unmount /storage for early native processes"
am: ee9554b2d9

Change-Id: I985413323a86816b392bd00211c550aef93328ae
2019-03-08 17:55:15 -08:00
Treehugger Robot
ee9554b2d9 Merge "Don't unmount /storage for early native processes" 2019-03-09 01:33:40 +00:00