bool integrity_supported:1;
        bool singleton:1;
        bool all_blk_mq:1;
+       unsigned integrity_added:1;
 
        /*
         * Indicates the rw permissions for the new logical
                t->immutable_target_type = tgt->type;
        }
 
+       if (dm_target_has_integrity(tgt->type))
+               t->integrity_added = 1;
+
        tgt->table = t;
        tgt->begin = start;
        tgt->len = len;
        struct mapped_device *md = t->md;
        struct gendisk *template_disk = NULL;
 
+       /* If target handles integrity itself do not register it here. */
+       if (t->integrity_added)
+               return 0;
+
        template_disk = dm_table_get_integrity_disk(t);
        if (!template_disk)
                return 0;
 {
        struct gendisk *template_disk = NULL;
 
+       if (t->integrity_added)
+               return;
+
        if (t->integrity_supported) {
                /*
                 * Verify that the original integrity profile
 
  */
 typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio);
 
+/*
+ * A target implements own bio data integrity.
+ */
+#define DM_TARGET_INTEGRITY            0x00000010
+#define dm_target_has_integrity(type)  ((type)->features & DM_TARGET_INTEGRITY)
+
 struct dm_target {
        struct dm_table *table;
        struct target_type *type;