From: Milan Broz Date: Thu, 13 Dec 2007 14:15:51 +0000 (+0000) Subject: dm crypt: fix write endio X-Git-Tag: v2.6.24-rc6~4^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=adfe47702c4726b3e045f9f83178def02833be4c;p=platform%2Fkernel%2Flinux-3.10.git 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 Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 28c6ae0..30d51a0 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);