diff options
Diffstat (limited to 'drivers/md/dm-crypt.c')
-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) | |||
511 | struct crypt_config *cc = io->target->private; | 511 | struct crypt_config *cc = io->target->private; |
512 | unsigned read_io = bio_data_dir(clone) == READ; | 512 | unsigned read_io = bio_data_dir(clone) == READ; |
513 | 513 | ||
514 | if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error)) | ||
515 | error = -EIO; | ||
516 | |||
514 | /* | 517 | /* |
515 | * free the processed pages | 518 | * free the processed pages |
516 | */ | 519 | */ |
@@ -519,10 +522,8 @@ static void crypt_endio(struct bio *clone, int error) | |||
519 | goto out; | 522 | goto out; |
520 | } | 523 | } |
521 | 524 | ||
522 | if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) { | 525 | if (unlikely(error)) |
523 | error = -EIO; | ||
524 | goto out; | 526 | goto out; |
525 | } | ||
526 | 527 | ||
527 | bio_put(clone); | 528 | bio_put(clone); |
528 | kcryptd_queue_crypt(io); | 529 | kcryptd_queue_crypt(io); |