summaryrefslogtreecommitdiff
path: root/scripts/payload_info.py
diff options
context:
space:
mode:
authorKelvin Zhang <zhangkelvin@google.com>2021-05-10 17:53:14 -0400
committerKelvin Zhang <zhangkelvin@google.com>2021-05-12 15:45:59 +0000
commit8704c83dbea63aa635b1a3689802da35374287c6 (patch)
tree376455c2dcc584bf69949b179064604c421c159d /scripts/payload_info.py
parente012f65a1b79f5d3a6496c5977fea4b811a7584c (diff)
Write verity first, then do fs verification
Old behavior: Read partition, for each block: Update hasher Update verity writer before reading hashtree/verity: write hashtree/verity to disk Read the last verity blocks. Finalize hasher, verity hashes. The old bahvior tries to minimize fs read by only read once and feed data to hasher and verity writer. However, in VABC, reading/writing are handled very differently. Read can be done via regular fd, but writes must go through special COW API. As we have seen in b/186196758, using COW API in filesystem hashing can lead to inconsistent read and boot failure. Therefore, we've decided to write verity first using COW API, then read/hash partition using regular fd. This does mean that we need to read everything twice, but we think this is a worth while tradeoff. As verity writes can take 5 minutes, but reading the entire partition again only takes <10 seconds. New behavior: Read partition, for each block: Update verity writer Finalize verity writer, write verity to disk launch snapuserd, open a regular fd. Read partition, for each block: Update hasher Finaliaze hasher, verity hashes. Test: th Test: Manual testing on pixel of the following scenario: 1. Verity enabled, VABC enabled, pause/resume multiple times 2. Verity disabled, VABC enabled, pause/resume multiple times 3. Verity Enabled, VABC enabled, pause/resume multiple times Bug: 186196758 Change-Id: I2477c2dc4da5b921e84b48a54d0d8a877c1a52ef
Diffstat (limited to 'scripts/payload_info.py')
0 files changed, 0 insertions, 0 deletions