Skip to contentSkip to conversation

dm crypt: disable barriers

PATCH In review Alasdair G Kergon 1 participant 1 message May 8, 2007 Device mapper

lore
Share & tools
lore

Alasdair G Kergon

author maintainer
#0 lore raw

PATCH 3/26 dm crypt: disable barriers

From: Milan Broz <[email protected]>

Disable barriers in dm-crypt because of current workqueue processing can reorder requests.

This must be addresed later but for now disabling barriers is needed to prevent data corruption.

---

 drivers/md/dm-crypt.c |    3 +++
 1 files changed, 3 insertions(+)
drivers/md/dm-crypt.c +3 -0
Index: linux-2.6.21/drivers/md/dm-crypt.c
===================================================================
@@ -954,6 +954,9 @@ static int crypt_map(struct dm_target *t
 	struct crypt_config *cc = ti->private;
 	struct crypt_io *io;
 
+	if (bio_barrier(bio))
+		return -EOPNOTSUPP;
+
 	io = mempool_alloc(cc->io_pool, GFP_NOIO);
 	io->target = ti;
 	io->base_bio = bio;