@@ -1013,10 +1013,18 @@ static void verity_io_hints(struct dm_target *ti, struct queue_limits *limits)
if (limits->physical_block_size < 1 << v->data_dev_block_bits)
limits->physical_block_size = 1 << v->data_dev_block_bits;
blk_limits_io_min(limits, limits->logical_block_size);
+
+ /*
+ * Similar to what dm-crypt does, opt dm-verity out of support for
+ * direct I/O that is aligned to less than the traditional direct I/O
+ * alignment requirement of logical_block_size. This prevents dm-verity
+ * data blocks from crossing pages, eliminating various edge cases.
+ */
+ limits->dma_alignment = limits->logical_block_size - 1;
}
static void verity_dtr(struct dm_target *ti)
{
struct dm_verity *v = ti->private;