OSDN Git Service

Merge branch 'uaccess.csum' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[tomoyo/tomoyo-test1.git] / block / blk-integrity.c
index ff1070e..c03705c 100644 (file)
@@ -409,6 +409,13 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template
        bi->tag_size = template->tag_size;
 
        disk->queue->backing_dev_info->capabilities |= BDI_CAP_STABLE_WRITES;
+
+#ifdef CONFIG_BLK_INLINE_ENCRYPTION
+       if (disk->queue->ksm) {
+               pr_warn("blk-integrity: Integrity and hardware inline encryption are not supported together. Disabling hardware inline encryption.\n");
+               blk_ksm_unregister(disk->queue);
+       }
+#endif
 }
 EXPORT_SYMBOL(blk_integrity_register);