diff options
author | Milan Broz <mbroz@redhat.com> | 2007-12-13 17:15:51 +0300 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2007-12-20 20:32:10 +0300 |
commit | adfe47702c4726b3e045f9f83178def02833be4c (patch) | |
tree | fae799e3c2aacc5f3828f18f2541420c9e967a49 /drivers/md | |
parent | d1622e89099b7cdda20d95a68940067bdddda03c (diff) | |
download | linux-adfe47702c4726b3e045f9f83178def02833be4c.tar.xz |
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.c | 7 |
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); |