diff options
author | Milan Broz <mbroz@redhat.com> | 2007-12-13 09:15:51 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2007-12-20 12:32:10 -0500 |
commit | adfe47702c4726b3e045f9f83178def02833be4c (patch) | |
tree | fae799e3c2aacc5f3828f18f2541420c9e967a49 | |
parent | d1622e89099b7cdda20d95a68940067bdddda03c (diff) |
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>
-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); |