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

Commit 00c6e542 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "md: dm-default-key: Override dun value for selected bios"

parents 8fd8b33f 9bd87b6e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -391,11 +391,14 @@ static int default_key_map(struct dm_target *ti, struct bio *bio)
	if (WARN_ON_ONCE(dun[0] > dkc->max_dun))
		return DM_MAPIO_KILL;

	if (!bio_has_crypt_ctx(bio))
	if (!bio_has_crypt_ctx(bio)) {
		bio_crypt_set_ctx(bio, &dkc->key, dun, GFP_NOIO);

		if (dkc->set_dun)
			default_key_map_dun(bio, dun);
	} else {
		if (dkc->set_dun && bio->bi_crypt_context->is_ext4)
			default_key_map_dun(bio, dun);
	}

	return DM_MAPIO_REMAPPED;
}