Commit graph

2977 commits

Author SHA1 Message Date
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
a83d0fe1b6 Merge "Fix bogus error checking on unique_fd" am: 95587b085e am: 3e9b69bf77
am: eb2be538c0

Change-Id: I7bf25301ca157fc7d508e03d32d037987a29ecf3
2019-03-28 21:32:18 -07:00
Bernie Innocenti
eb2be538c0 Merge "Fix bogus error checking on unique_fd" am: 95587b085e
am: 3e9b69bf77

Change-Id: Id54116718b97057f978e1410a96bfb449999f832
2019-03-28 21:15:34 -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
TreeHugger Robot
9cfc0b4b17 Merge "vold: fsync both file and directory after write keys" 2019-03-28 08:44:30 +00:00
TreeHugger Robot
32212df196 Merge "vold: Introduce android::vold::writeStringToFile" 2019-03-28 08:44:12 +00:00
Tommy Chiu
a98464f688 vold: fsync both file and directory after write keys
Use vold version of writeStringToFile which fsync files, and
manually fsync directories after initialize global DE

Bug: 71810347
Test: Build pass and reboot stress test.
      Original boot failure symptom is NOT reproducible.

Change-Id: I1ca8f8cf0ccfd01075a9c33f79042e58d99aea26
2019-03-28 08:43:24 +00: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
0873a1c71c Merge "Switch Checkpoint health sleep time to ms." am: 32a8a47b07 am: e6db7e0a23
am: 2cc8752935

Change-Id: I125122b44009e2cb11e7cf6c147c9a808a87b8a2
2019-03-26 19:53:51 -07:00
Daniel Rosenberg
2cc8752935 Merge "Switch Checkpoint health sleep time to ms." am: 32a8a47b07
am: e6db7e0a23

Change-Id: If71daebf5bd2d91f5dfbadee4c7707c10b667648
2019-03-26 19:49:51 -07: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
38f7671916 Merge "Fixed min_free_bytes prop name and usleep time default" am: 7522da3036 am: 23e15b78ad
am: 511073b610

Change-Id: Ic796c1d7f636bb5718eee599e25aed83784bd246
2019-03-26 19:26:30 -07:00
Daniel Rosenberg
511073b610 Merge "Fixed min_free_bytes prop name and usleep time default" am: 7522da3036
am: 23e15b78ad

Change-Id: I33e4655486ec05fbd9ea66e467aaa1dce440edf9
2019-03-26 19:22:27 -07: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
Suren Baghdasaryan
11a6b56ac8 Merge "Convert ifstream usage into fopen() to prevent fd leaks into child processes" am: 93fb6083d4 am: f1dec58b61
am: 1efcfc30b1

Change-Id: Iacc7caa16478c167462ca5645f5eabfa34381896
2019-03-26 19:07:20 -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
1efcfc30b1 Merge "Convert ifstream usage into fopen() to prevent fd leaks into child processes" am: 93fb6083d4
am: f1dec58b61

Change-Id: Id7e8626129dbda0fdafcc86b087b67f71b5d3f8a
2019-03-26 18:57:14 -07: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
Tommy Chiu
0bd2d11692 vold: Introduce android::vold::writeStringToFile
Remove static definition of writeStringToFile, and
move it from KeyStorage to Utils

Bug: 71810347
Change-Id: I38bfd27370ac2372e446dc699f518122e73c6877
2019-03-26 17:38:13 +08:00
Rubin Xu
5b4f31125e Merge "Remove excess logging in secdiscard" am: b640f4e337 am: 2c1e98d69f
am: b970f62913

Change-Id: Icce53ecc1e43945cd1298edbf3e70005340432d9
2019-03-22 06:27:47 -07:00
Rubin Xu
b970f62913 Merge "Remove excess logging in secdiscard" am: b640f4e337
am: 2c1e98d69f

Change-Id: I767847aa355adf893189e329b67c78a5145245e3
2019-03-22 06:23:33 -07: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
149ed5fb3c Merge changes I977cc03b,I7b621476,Ib57f4461 am: 58551c0568 am: 5da6d2a0f9
am: 6647c75d3c

Change-Id: Iecf990d139b98ba2788cb6ba82e6673c28bb08c2
2019-03-21 14:28:39 -07:00
Daniel Rosenberg
6647c75d3c Merge changes I977cc03b,I7b621476,Ib57f4461 am: 58551c0568
am: 5da6d2a0f9

Change-Id: I98125f4b3277601bf2795e76cb8b8b889e1725e4
2019-03-21 14:23:22 -07: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
178ee0ded1 Merge "Shell no longer globs, so glob in pushBackContents" am: a41b7849d0 am: 04017039b7
am: 612065e22b

Change-Id: I296bf6ce7d616e3615e2a39293b2b60c2ce85c4d
2019-03-19 12:39:54 -07:00
Paul Crowley
612065e22b Merge "Shell no longer globs, so glob in pushBackContents" am: a41b7849d0
am: 04017039b7

Change-Id: Ifc9ef0e513dd3d7ed6d0b67ddbec236145196b18
2019-03-19 12:35:48 -07: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
183f8cd213 Merge "Add vdc checkpoint supportsBlockCheckpoint" am: 860c731158 am: 4c5ce24e80
am: ca54294cf8

Change-Id: Ibee238347b863404670e972f41cebcb4986c8435
2019-03-18 16:47:37 -07:00
Paul Lawrence
ca54294cf8 Merge "Add vdc checkpoint supportsBlockCheckpoint" am: 860c731158
am: 4c5ce24e80

Change-Id: I60320da84c973841b4efd425e0cfc7cc81052fe6
2019-03-18 16:27:46 -07: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
a475189b32 Merge "Fsync directories before delete key" am: 7573874d3f am: 3a38070bbf
am: 08613423ee

Change-Id: I6007af911ba3fcafad590d33deea25a5c55b03c3
2019-03-14 08:44:08 -07:00
Chris Fries
08613423ee Merge "Fsync directories before delete key" am: 7573874d3f
am: 3a38070bbf

Change-Id: I568a6e8a39929b77ba76b021657e248a4e49e470
2019-03-14 08:40:08 -07:00