mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6.24 PATCH 03/06] dm crypt: fix write endio
@ 2007-12-13 14:43 Alasdair G Kergon
  0 siblings, 0 replies; only message in thread
From: Alasdair G Kergon @ 2007-12-13 14:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: dm-devel, linux-kernel, Milan Broz, stable, dm-crypt

From: Milan Broz <mbroz@redhat.com>

Fix BIO_UPTODATE test for write io.

Cc: stable@kernel.org
Cc: dm-crypt@saout.de
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
---
 drivers/md/dm-crypt.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6.24-rc5/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.24-rc5.orig/drivers/md/dm-crypt.c	2007-12-12 15:40:33.000000000 +0000
+++ linux-2.6.24-rc5/drivers/md/dm-crypt.c	2007-12-12 15:43:11.000000000 +0000
@@ -511,6 +511,9 @@ static void crypt_endio(struct bio *clon
 	struct crypt_config *cc = io->target->private;
 	unsigned read_io = bio_data_dir(clone) == READ;
 
+	if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error))
+		error = -EIO;
+
 	/*
 	 * free the processed pages
 	 */
@@ -519,10 +522,8 @@ static void crypt_endio(struct bio *clon
 		goto out;
 	}
 
-	if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) {
-		error = -EIO;
+	if (unlikely(error))
 		goto out;
-	}
 
 	bio_put(clone);
 	kcryptd_queue_crypt(io);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-13 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-13 14:43 [2.6.24 PATCH 03/06] dm crypt: fix write endio Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®