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>

authored by Milan Broz and committed by Alasdair G Kergon adfe4770 d1622e89

+4 -3
+4 -3
drivers/md/dm-crypt.c
··· 511 511 struct crypt_config *cc = io->target->private; 512 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 518 * free the processed pages 516 519 */ ··· 522 519 goto out; 523 520 } 524 521 525 - if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) { 526 - error = -EIO; 522 + if (unlikely(error)) 527 523 goto out; 528 - } 529 524 530 525 bio_put(clone); 531 526 kcryptd_queue_crypt(io);