Use the flag CRYPTO_ALG_ENCRYPT_READ_ONCE. If the flag is set, we don't have to copy when encrypting and we can revert to old behavior. Signed-off-by: Mikulas Patocka --- drivers/md/dm-crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.25.3/drivers/md/dm-crypt.c =================================================================== --- linux-2.6.25.3.orig/drivers/md/dm-crypt.c 2008-05-23 21:04:49.000000000 +0200 +++ linux-2.6.25.3/drivers/md/dm-crypt.c 2008-05-23 21:04:58.000000000 +0200 @@ -361,7 +361,7 @@ static int crypt_convert_block(struct cr crypto_ablkcipher_alignmask(cc->tfm) + 1); sg_init_table(&dmreq->sg_in, 1); - if (bio_data_dir(ctx->bio_in) == WRITE) { + if (bio_data_dir(ctx->bio_in) == WRITE && !(cc->tfm->base.__crt_alg->cra_flags & CRYPTO_ALG_ENCRYPT_READ_ONCE)) { char *page_in = kmap_atomic(bv_in->bv_page, KM_USER0); char *page_out = kmap_atomic(bv_out->bv_page, KM_USER1); memcpy(page_out + bv_out->bv_offset + ctx->offset_out, page_in + bv_in->bv_offset + ctx->offset_in, 1 << SECTOR_SHIFT);