dm-crypt reordering BIOs across barriers?

Richard Yao
2013-06-08T03:48:17Z

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

When you use dm-crypt, block IO requests to a dm-* device will invoke
dm_request_fn() -> map_request() -> crypt_map(). If a BIO is a write
barrier, crypt_map() will return DM_MAPIO_REMAPPED to map_request(),
which will immediately queue it to the device.

If a few dozen IOs are queued in rapid succession with multiple write
barriers, all write barriers will be executed before any actual write
BIOs occur because the write IOs will be processed asynchronously in a
work queue. Since the barriers will be long gone by the time the write
IOs are queued, they can be queued in any order.

Am I misunderstanding this or is dm-crypt ignoring proper write barrier
semantics?

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]