From 20bd93bcc467a1e1e1d0f61c32824efcdb2e1bbe Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 20 Apr 2018 19:26:09 -0700 Subject: [PATCH] dm-default-key: fix wrong encryption/decryption when f2fs moves blocks commit 2b425b7413e2 ("dm-default-key, f2fs, ICE: support dm-default-key with f2fs/ICE") supports bio->bi_crypt_skip, so this patch should address the original issue by adding this condition. Change-Id: I215cd9d02e364af07eebf388000809cdf0cce472 Signed-off-by: Jaegeuk Kim Signed-off-by: Shivaprasad Hongal Signed-off-by: Neeraj Soni --- drivers/md/dm-default-key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-default-key.c b/drivers/md/dm-default-key.c index 7cc7ea7f5748..ca50de11b6d0 100644 --- a/drivers/md/dm-default-key.c +++ b/drivers/md/dm-default-key.c @@ -133,7 +133,7 @@ static int default_key_map(struct dm_target *ti, struct bio *bio) dm_target_offset(ti, bio->bi_iter.bi_sector); } - if (!bio->bi_crypt_key) + if (!bio->bi_crypt_key && !bio->bi_crypt_skip) bio->bi_crypt_key = &dkc->key; return DM_MAPIO_REMAPPED;