From aa08e58e3a5d66bf3714c537336337b766458d9f Mon Sep 17 00:00:00 2001 From: liminghao Date: Wed, 6 Jan 2016 10:30:49 +0800 Subject: [PATCH] cryptfs: Skip to encrtypt unused blocks into a block group which uninitialize block bitmap . Bug: 198288 Change-Id: Iaa1a14fd916ddec8dc1a4be18d49732ebcba6884 Signed-off-by: liminghao --- cryptfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cryptfs.c b/cryptfs.c index 1f70847..f5a065a 100644 --- a/cryptfs.c +++ b/cryptfs.c @@ -2371,7 +2371,8 @@ static int encrypt_groups(struct encryptGroupsData* data) data->count = 0; for (block = 0; block < block_count; block++) { - int used = bitmap_get_bit(block_bitmap, block); + int used = (aux_info.bg_desc[i].bg_flags & EXT4_BG_BLOCK_UNINIT) ? + 0 : bitmap_get_bit(block_bitmap, block); update_progress(data, used); if (used) { if (data->count == 0) {