summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2007-12-13 14:15:51 +0000
committerAlasdair G Kergon <agk@redhat.com>2007-12-20 17:32:10 +0000
commitadfe47702c4726b3e045f9f83178def02833be4c (patch)
treefae799e3c2aacc5f3828f18f2541420c9e967a49
parentd1622e89099b7cdda20d95a68940067bdddda03c (diff)
dm crypt: fix write endio
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>
-rw-r--r--drivers/md/dm-crypt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 28c6ae095c56..30d51a0c0116 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -511,6 +511,9 @@ static void crypt_endio(struct bio *clone, int error)
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 *clone, int error)
goto out;
}
- if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) {
- error = -EIO;
+ if (unlikely(error))
goto out;
- }
bio_put(clone);
kcryptd_queue_crypt(io);