summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2007-12-13 15:15:51 +0100
committerAlasdair G Kergon <agk@redhat.com>2007-12-20 18:32:10 +0100
commitadfe47702c4726b3e045f9f83178def02833be4c (patch)
treefae799e3c2aacc5f3828f18f2541420c9e967a49 /drivers/md
parentdm mpath: hp requires scsi (diff)
downloadlinux-adfe47702c4726b3e045f9f83178def02833be4c.tar.xz
linux-adfe47702c4726b3e045f9f83178def02833be4c.zip
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>
Diffstat (limited to 'drivers/md')
-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);