LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: Marti Raudsepp <marti@juffo.org>
Cc: Alasdair G Kergon <agk@redhat.com>,
	Lennart Sorensen <lsorense@csclub.uwaterloo.ca>,
	device-mapper development <dm-devel@redhat.com>,
	Kernel hackers <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christophe Saout <christophe@saout.de>
Subject: [PATCH] disable barriers in dm-crypt [was Re: BUG: Files corrupt after moving LVM volume to USB disk]
Date: Fri, 23 Mar 2007 15:45:26 +0100	[thread overview]
Message-ID: <4603E806.3030205@redhat.com> (raw)
In-Reply-To: <2a12af650703221742p6691f4b5i21667a5c98217fb6@mail.gmail.com>

> Summary of what I've managed to rule out so far:
>1. this problem does not occur without dm-crypt

Please could you test attached patch ?
Sorry for another annoying reboot :-)

Milan
--
mbroz@redhat.com



From: Milan Broz <mbroz@redhat.com>

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.

Signed-off-by: Milan Broz <mbroz@redhat.com>

Index: linux-2.6.20.1/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.20.1.orig/drivers/md/dm-crypt.c	2007-03-23 15:07:11.000000000 +0100
+++ linux-2.6.20.1/drivers/md/dm-crypt.c	2007-03-23 15:09:59.000000000 +0100
@@ -925,6 +925,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;



  reply	other threads:[~2007-03-23 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070322000348.92631512.akpm@linux-foundation.org>
     [not found] ` <20070322153301.GN27600@agk.surrey.redhat.com>
2007-03-23  0:42   ` [dm-devel] Fw: BUG: Files corrupt after moving LVM volume to USB disk Marti Raudsepp
2007-03-23 14:45     ` Milan Broz [this message]
2007-03-26  0:05       ` [PATCH] disable barriers in dm-crypt [was Re: BUG: Files corrupt after moving LVM volume to USB disk] Marti Raudsepp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4603E806.3030205@redhat.com \
    --to=mbroz@redhat.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=christophe@saout.de \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=marti@juffo.org \
    --subject='[PATCH] disable barriers in dm-crypt [was Re: BUG: Files corrupt after moving LVM volume to USB disk]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).