Skip to content

Commit

Permalink
dm crypt: fix write endio
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Milan Broz authored and kergon committed Dec 20, 2007
1 parent d1622e8 commit adfe477
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/md/dm-crypt.c
Expand Up @@ -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
*/
Expand All @@ -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);
Expand Down

0 comments on commit adfe477

Please sign in to comment.