]> www.infradead.org Git - users/dwmw2/linux.git/commit
dm-verity: provide dma_alignment limit in io_hints
authorEric Biggers <ebiggers@kernel.org>
Tue, 2 Jul 2024 14:39:51 +0000 (16:39 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Wed, 3 Jul 2024 19:41:08 +0000 (21:41 +0200)
commit09d1430896e38933470045408d7a350dac7d841b
treee5693440dd3943ec37d543fd08d5376b02b271c4
parenta7ddb3d49d16e1774b4d5b814d3469ee9c3830c0
dm-verity: provide dma_alignment limit in io_hints

Since Linux v6.1, some filesystems support submitting direct I/O that is
aligned to only dma_alignment instead of the logical_block_size
alignment that was required before.  I/O that is not aligned to the
logical_block_size is difficult to handle in device-mapper targets that
do cryptographic processing of data, as it makes the units of data that
are hashed or encrypted possibly be split across pages, creating rarely
used and rarely tested edge cases.

As such, dm-crypt and dm-integrity have already opted out of this by
setting dma_alignment to 'logical_block_size - 1'.

Although dm-verity does have code that handles these cases (or at least
is intended to do so), supporting direct I/O with such a low amount of
alignment is not really useful on dm-verity devices.  So, opt dm-verity
out of it too so that it's not necessary to handle these edge cases.

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-verity-target.c