On 7/30/2025 6:46 PM, Mikulas Patocka wrote:


On Wed, 30 Jul 2025, LongPing Wei wrote:

dm-thin obviously can pass through inline crypto support.

Hi

I'm not sure about it. What if dm-thin performs copy-on-write? How would
that interact with inline crypto?

Mikulas

Hi, Mikulas

dm-thin's encryption behavior is the same as dm-bow's when COW occurs, and DM_TARGET_PASSES_CRYPTO has already been set to dm-bow.

The key and iv of inline crypto are passed in by the upper layer, which is not affected by the specific location of data blocks in thin-pool.

LongPing Wei>> Signed-off-by: LongPing Wei <weilongp...@oppo.com>
---
  drivers/md/dm-thin.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 05cf4e3f2bbe..42f218dcf99f 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -4111,7 +4111,7 @@ static void pool_io_hints(struct dm_target *ti, struct 
queue_limits *limits)
  static struct target_type pool_target = {
        .name = "thin-pool",
        .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE |
-                   DM_TARGET_IMMUTABLE,
+                   DM_TARGET_IMMUTABLE | DM_TARGET_PASSES_CRYPTO,
        .version = {1, 23, 0},
        .module = THIS_MODULE,
        .ctr = pool_ctr,
@@ -4509,6 +4509,7 @@ static struct target_type thin_target = {
        .status = thin_status,
        .iterate_devices = thin_iterate_devices,
        .io_hints = thin_io_hints,
+       .features = DM_TARGET_PASSES_CRYPTO,
  };
/*----------------------------------------------------------------*/
--
2.34.1




Reply via email to