Commit graph

71965 commits

Author SHA1 Message Date
Stephen Crane
39e256cb31 [automerger skipped] [storageproxyd] Dump binary buffers to log instead of stderr am: 77e2af18be -s ours am: c898d12eda -s ours
am skip reason: Merged-In Iecc0d4680420bb92c94be628789093888a2f1941 with SHA-1 f647221827 is already in history

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

Change-Id: I782b7b1e24622e2c4b5fc8174703d8a4108df10c
2021-10-05 19:36:29 +00:00
Stephen Crane
56428d1f7c [automerger skipped] storageproxyd: Add logging of failed RPMB transactions am: bf6e22a318 -s ours am: a2613eace1 -s ours
am skip reason: Merged-In I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa with SHA-1 642d977bc8 is already in history

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

Change-Id: I637187d82ca9028e23f9abee191fe418450fea06
2021-10-05 19:36:28 +00:00
Stephen Crane
934043d87e [automerger skipped] storageproxyd: Add file handle param to debug buffer print am: 4ee811ee46 -s ours am: d10e28fc29 -s ours
am skip reason: Merged-In Iade322a21312a676b3599bddafdfc43b599617ea with SHA-1 3bb483b196 is already in history

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

Change-Id: Ia0454c9c8939b5626367db01bd2a8b5198a7f659
2021-10-05 19:36:27 +00:00
Stephen Crane
c898d12eda [automerger skipped] [storageproxyd] Dump binary buffers to log instead of stderr am: 77e2af18be -s ours
am skip reason: Merged-In Iecc0d4680420bb92c94be628789093888a2f1941 with SHA-1 f647221827 is already in history

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

Change-Id: I55e606476410febd80dbad2662f6f75c3521d239
2021-10-05 19:21:59 +00:00
Stephen Crane
a2613eace1 [automerger skipped] storageproxyd: Add logging of failed RPMB transactions am: bf6e22a318 -s ours
am skip reason: Merged-In I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa with SHA-1 642d977bc8 is already in history

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

Change-Id: Ifa30cff385ebaf558bde531b0bbc2777f9fbdd4b
2021-10-05 19:21:58 +00:00
Stephen Crane
d10e28fc29 [automerger skipped] storageproxyd: Add file handle param to debug buffer print am: 4ee811ee46 -s ours
am skip reason: Merged-In Iade322a21312a676b3599bddafdfc43b599617ea with SHA-1 3bb483b196 is already in history

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

Change-Id: I3e4dc6d20f02fcfcb5118adc7c21caa1fde4df06
2021-10-05 19:21:58 +00:00
Stephen Crane
77e2af18be [storageproxyd] Dump binary buffers to log instead of stderr
Rewrites the buffer logging to print to the Android log instead of
stderr. The storageproxyd service is started by init and stderr is not
logged anywhere. Because we want to log sense data errors under normal
operation, we need to log to logcat instead of stderr.

Test: Define RPMB_DEBUG, build for qemu-trusty, run, inspect logcat
Bug: 195544379
Change-Id: Iecc0d4680420bb92c94be628789093888a2f1941
Merged-In: Iecc0d4680420bb92c94be628789093888a2f1941
2021-10-05 09:55:10 -07:00
Stephen Crane
bf6e22a318 storageproxyd: Add logging of failed RPMB transactions
Adds parsing and logging of SCSI errors from SG_IO calls for RPMB. Does
not alter behavior of the RPMB proxy in response to these errors.

Test: m storageproxyd
Bug: 195544379
Change-Id: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
Merged-In: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
2021-10-05 09:55:03 -07:00
Stephen Crane
4ee811ee46 storageproxyd: Add file handle param to debug buffer print
Adds a file handle parameter to the debug print_buf function to allow
printing to either stdout or stderr.

Test: m storageproxyd
Bug: 195544379
Change-Id: Iade322a21312a676b3599bddafdfc43b599617ea
Merged-In: Iade322a21312a676b3599bddafdfc43b599617ea
(cherry picked from commit 3bb483b196)
2021-10-05 09:54:58 -07:00
Stephen Crane
fdcfe7d643 storageproxyd: Retry RPMB request on UNIT ATTENTION am: d1a212e0d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15972861

Change-Id: Ibdcf151f12cbed45879140bcce4eac72ebf75b18
2021-10-04 23:35:09 +00:00
Stephen Crane
d1a212e0d8 storageproxyd: Retry RPMB request on UNIT ATTENTION
Attempts a retry of the intial write or read when an RPMB command
triggers a UNIT ATTENTION condition. This causes the UA status to be
reset and hopefully result in a successful command. This runs the risk
of retrying a successful write, but we wouldn't have been able to get
the RPMB response after that write anyway due to the UA condition.

Test: m storageproxyd
Bug: 194712579
Change-Id: Ib970e779365bb396756c114684c7f6e56a737ab1
Merged-In: Ib970e779365bb396756c114684c7f6e56a737ab1
(cherry picked from commit a9085181af)
2021-10-04 18:50:24 +00:00
Stephen Crane
89d67fb45c storageproxyd: Fix inverted conditional in error checking am: dcdac24306
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15910108

Change-Id: I9401a7e321fb7def9bae76fed54e89a17bfcddc6
2021-09-25 17:14:54 +00:00
Stephen Crane
dcdac24306 storageproxyd: Fix inverted conditional in error checking
check_scci_sense (now renamed unexpected_scsi_sense) was supposed to
return false iff the sense data was valid and did not contain an error.
This return value was inverted. Invert the return values and rename the
function to clarify its role.

Test: m storageproxyd
Bug: 195544379
Change-Id: I3b84188aabe58345a83d2fd57bb8103e730cf365
Merged-In: I3b84188aabe58345a83d2fd57bb8103e730cf365
2021-09-24 14:35:04 -07:00
Stephen Crane
878af40b53 Merge changes Iecc0d468,I928ddebc,Iade322a2 into sc-qpr1-dev am: 1d9e35c5bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15840709

Change-Id: I1d2efafb1d84581bb72359f3fa411a596a057f57
2021-09-17 23:33:43 +00:00
Stephen Crane
151adfd2ce storageproxyd: Add logging of failed RPMB transactions am: 642d977bc8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15789187

Change-Id: I2e54d68b2f34880050f5e8eaba6871409a8a315f
2021-09-17 23:33:43 +00:00
Stephen Crane
7e23887bf2 storageproxyd: Add file handle param to debug buffer print am: 3bb483b196
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15787946

Change-Id: I4c8edb5e565776803cabc21efbedfcb9786a8172
2021-09-17 23:33:42 +00:00
Stephen Crane
1d9e35c5bf Merge changes Iecc0d468,I928ddebc,Iade322a2 into sc-qpr1-dev
* changes:
  [storageproxyd] Dump binary buffers to log instead of stderr
  storageproxyd: Add logging of failed RPMB transactions
  storageproxyd: Add file handle param to debug buffer print
2021-09-17 23:17:52 +00:00
Akilesh Kailash
c9a4c17a1a Merge changes I779184f1,I241ee11d into sc-qpr1-dev am: d6383199e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15825056

Change-Id: I1eb2a86623258bf10081f908bfc3b6187b244e93
2021-09-17 18:33:14 +00:00
Akilesh Kailash
b6e9ccea8b snapuserd: I/O request on sectors not mapping to any COW op am: f7185915be
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15825055

Change-Id: I329f41ed268bfcec88a024846e38223511b9b263
2021-09-17 18:33:14 +00:00
Akilesh Kailash
d6383199e8 Merge changes I779184f1,I241ee11d into sc-qpr1-dev
* changes:
  libsnapshot: Error handling after QuerySnapshotStatus
  snapuserd: I/O request on sectors not mapping to any COW op
2021-09-17 18:17:51 +00:00
Akilesh Kailash
ab12b4e8ff libsnapshot: Error handling after QuerySnapshotStatus
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-17 18:16:20 +00:00
Akilesh Kailash
f7185915be snapuserd: I/O request on sectors not mapping to any COW op
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-17 18:14:42 +00:00
Stephen Crane
642d977bc8 storageproxyd: Add logging of failed RPMB transactions
Adds parsing and logging of SCSI errors from SG_IO calls for RPMB. Does
not alter behavior of the RPMB proxy in response to these errors.

Test: m storageproxyd
Bug: 195544379
Change-Id: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
Merged-In: I928ddebcb65aa6c305d3dcab7c64bd19d11a50fa
2021-09-15 18:14:18 -07:00
Stephen Crane
3bb483b196 storageproxyd: Add file handle param to debug buffer print
Adds a file handle parameter to the debug print_buf function to allow
printing to either stdout or stderr.

Test: m storageproxyd
Bug: 195544379
Change-Id: Iade322a21312a676b3599bddafdfc43b599617ea
Merged-In: Iade322a21312a676b3599bddafdfc43b599617ea
2021-09-15 18:14:18 -07:00
Stephen Crane
f647221827 [storageproxyd] Dump binary buffers to log instead of stderr
Rewrites the buffer logging to print to the Android log instead of
stderr. The storageproxyd service is started by init and stderr is not
logged anywhere. Because we want to log sense data errors under normal
operation, we need to log to logcat instead of stderr.

Test: Define RPMB_DEBUG, build for qemu-trusty, run, inspect logcat
Bug: 195544379
Change-Id: Iecc0d4680420bb92c94be628789093888a2f1941
Merged-In: Iecc0d4680420bb92c94be628789093888a2f1941
2021-09-15 18:14:18 -07:00
David Anderson
5e9708644c libsnapshot: Fix new partitions not transitioning in second-stage init. am: 5932ed07db
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15832178

Change-Id: Icb3f865e7420772c45167d3d0d33f42b6cadb121
2021-09-15 23:30:22 +00:00
David Anderson
5932ed07db libsnapshot: Fix new partitions not transitioning in second-stage init.
Bug: 196922070
Test: vts_libsnapshot_test
Merged-In: If8a7afde218fd719e4426dc1dda41f53a4e6544b
Change-Id: If8a7afde218fd719e4426dc1dda41f53a4e6544b
2021-09-15 00:43:20 +00:00
David Anderson
05fbdcd3eb libsnapshot: Fix missing source partitions when adding a new partition. am: 0a6f250242
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15670247

Change-Id: Ieda77c5fc8cf867cb62054e0a38321fdf528e311
2021-08-27 19:36:47 +00:00
David Anderson
0a6f250242 libsnapshot: Fix missing source partitions when adding a new partition.
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-25 00:02:39 +00:00
Bart Van Assche
f54487b6c3 Reduce the queue depth of loop devices used by the zram driver am: 1a9cad816d am: d5a663fde4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584614

Change-Id: I268f8e7799c66accbd293e7d331175eeff933872
2021-08-18 20:18:41 +00:00
Bart Van Assche
d5a663fde4 Reduce the queue depth of loop devices used by the zram driver am: 1a9cad816d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584614

Change-Id: Id0a6c5b0e7c9cb118df02a9be768b3f68dde43a9
2021-08-18 20:04:09 +00:00
Bart Van Assche
1a9cad816d Reduce the queue depth of loop devices used by the zram driver
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-18 11:00:31 -07:00
TreeHugger Robot
4dfc8528d8 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev am: de0cc6cc59 am: b155a9a8a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584613

Change-Id: Ib5046e3855f5c4249eed9676022a77aa93a1adce
2021-08-17 06:07:17 +00:00
TreeHugger Robot
b9f40f83eb Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev am: 232ec664b1 am: 10e14c95bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612

Change-Id: I3b11fd3d20d34a9440ddb74e96a75922877534c7
2021-08-17 06:07:10 +00:00
TreeHugger Robot
9e6087a88e Merge "Rename two local variables" into sc-dev am: d95943088e am: caef6def08
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611

Change-Id: I5080775507f23eb67293aadc3e2ce4e7f42e3fd1
2021-08-17 06:07:02 +00:00
TreeHugger Robot
b155a9a8a1 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev am: de0cc6cc59
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584613

Change-Id: I1221648f11e6fd2ccae40b1ad5d335c31ff8efa1
2021-08-17 05:52:31 +00:00
TreeHugger Robot
10e14c95bc Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev am: 232ec664b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612

Change-Id: I687f47d10a8aa8c955aab5e3c630f2c735e82c19
2021-08-17 05:52:19 +00:00
TreeHugger Robot
caef6def08 Merge "Rename two local variables" into sc-dev am: d95943088e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611

Change-Id: I1a7057d9dd955d425446985cf2ab16955efaa8ce
2021-08-17 05:52:07 +00:00
TreeHugger Robot
de0cc6cc59 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev 2021-08-17 05:38:11 +00:00
TreeHugger Robot
232ec664b1 Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev 2021-08-17 05:38:09 +00:00
TreeHugger Robot
d95943088e Merge "Rename two local variables" into sc-dev 2021-08-17 05:38:07 +00:00
TreeHugger Robot
e9aa841c95 Merge "Handle long responses by keymint IPC." into sc-dev am: a707c28937 am: ec759fe14d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15515450

Change-Id: Iab05aa4155a10ff9c0fcfcfbb1bd1a7e3dbf25b0
2021-08-16 20:37:19 +00:00
TreeHugger Robot
ec759fe14d Merge "Handle long responses by keymint IPC." into sc-dev am: a707c28937
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15515450

Change-Id: I87baacb3d5ac3854d648cecea3a615132e0d36db
2021-08-16 20:24:24 +00:00
TreeHugger Robot
a707c28937 Merge "Handle long responses by keymint IPC." into sc-dev 2021-08-16 20:07:15 +00:00
Bart Van Assche
9e54a90e54 libdm: Export ExtractBlockDeviceName()
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-16 11:04:40 -07:00
Bart Van Assche
96b21cc589 libdm: Make ExtractBlockDeviceName() return its result
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-16 11:04:35 -07:00
Bart Van Assche
c554240e64 Rename two local variables
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-16 11:04:18 -07:00
Max Bires
ab96ce997a Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev am: 98f87ca8a7 am: a19f6e3940
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15481660

Change-Id: I6cee24f3f1bc7d5ad7c41d726d2a505b9ef5bd13
2021-08-15 18:27:05 +00:00
Max Bires
a19f6e3940 Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev am: 98f87ca8a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15481660

Change-Id: Ifdee480b05d57c18f488365c7329b78417eb2774
2021-08-15 18:09:28 +00:00
Max Bires
98f87ca8a7 Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev 2021-08-15 17:55:48 +00:00