From 3bb6b25343309cfae76c5734ee31b7b2511aef60 Mon Sep 17 00:00:00 2001 From: Luiz Cressoni Date: Tue, 18 May 2021 08:09:29 -0300 Subject: [PATCH] APP data lost after first R upgrade Since the property ro.crypto.allow_encrypt_override wasn't set in Q file data in SDcard mounted as internal storage is double encrypted. So we need to revert the patch that skips encription if bio is fscrypto or blk-crypto encrypted to avoid decryption errors. Change-Id: Ic46973a092f00227e0fb2706788df4caa674607d Signed-off-by: Luiz Cressoni Reviewed-on: https://gerrit.mot.com/1952458 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ling Jin Submit-Approved: Jira Key --- drivers/md/dm-crypt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 7335393b101b..85365b535890 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2879,16 +2879,17 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) * - for REQ_PREFLUSH device-mapper core ensures that no IO is in-flight * - for REQ_OP_DISCARD caller must use flush if IO ordering matters */ +// BEGIN IKSWR-71527 lutcho@motorola.com 2021/05/11 +// bio_should_skip_dm_default_key(bio) reverted if (unlikely(bio->bi_opf & REQ_PREFLUSH || - bio_op(bio) == REQ_OP_DISCARD || - bio_should_skip_dm_default_key(bio))) { + bio_op(bio) == REQ_OP_DISCARD )){ bio_set_dev(bio, cc->dev->bdev); if (bio_sectors(bio)) bio->bi_iter.bi_sector = cc->start + dm_target_offset(ti, bio->bi_iter.bi_sector); return DM_MAPIO_REMAPPED; } - +// END IKSWR-71527 /* * Check if bio is too large, split as needed. */