Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5834e84 authored by Neeraj Soni's avatar Neeraj Soni
Browse files

dm-crypt: Skip encryption if bio is fscrypto or blk-crypto encrypted



Skip encryption of bio if it is already fs-crypto encrypted or is
supposed to be encrypted by blk-crypto.

Change-Id: I89053a2e0a63941265f5973f2f78786e69f0db37
Signed-off-by: default avatarNeeraj Soni <neersoni@codeaurora.org>
parent e9c4d140
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2880,7 +2880,8 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)
	 * - for REQ_OP_DISCARD caller must use flush if IO ordering matters
	 */
	if (unlikely(bio->bi_opf & REQ_PREFLUSH ||
	    bio_op(bio) == REQ_OP_DISCARD)) {
	    bio_op(bio) == REQ_OP_DISCARD ||
	    bio_should_skip_dm_default_key(bio))) {
		bio_set_dev(bio, cc->dev->bdev);
		if (bio_sectors(bio))
			bio->bi_iter.bi_sector = cc->start +