Merge "EncryptInPlace: ensure that backup superblocks get encrypted" am: 213dbe30a1
am: 5acfc3e8d5
am: d1a7e750e2
am: 891b367b0a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1385029 Change-Id: I5399da429b5177f129f0e907d50a5caed760aa31
This commit is contained in:
commit
a1189052ff
1 changed files with 10 additions and 3 deletions
|
@ -205,9 +205,16 @@ static int encrypt_groups(struct encryptGroupsData* data) {
|
|||
data->count = 0;
|
||||
|
||||
for (block = 0; block < block_count; block++) {
|
||||
int used = (aux_info.bg_desc[i].bg_flags & EXT4_BG_BLOCK_UNINIT)
|
||||
? 0
|
||||
: bitmap_get_bit(block_bitmap, block);
|
||||
int used;
|
||||
|
||||
if (aux_info.bg_desc[i].bg_flags & EXT4_BG_BLOCK_UNINIT) {
|
||||
// In block groups with an uninitialized block bitmap, we only
|
||||
// need to encrypt the backup superblock (if one is present).
|
||||
used = (ext4_bg_has_super_block(i) && block < 1 + aux_info.bg_desc_blocks);
|
||||
} else {
|
||||
used = bitmap_get_bit(block_bitmap, block);
|
||||
}
|
||||
|
||||
update_progress(data, used);
|
||||
if (used) {
|
||||
if (data->count == 0) {
|
||||
|
|
Loading…
Reference in a new issue