X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-crypt.c;h=31e498fd87785b5ccfaa804a708f3fe3e7d9c4ea;hb=c469b50b11a8eaa1dc314687c2b6030c8fdea5b7;hp=6022ed12a795d61ce41ff9245a0665a8f5c0838b;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 6022ed12a..31e498fd8 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -717,13 +717,15 @@ static int crypt_endio(struct bio *bio, unsigned int done, int error) if (bio->bi_size) return 1; + if (!bio_flagged(bio, BIO_UPTODATE) && !error) + error = -EIO; + bio_put(bio); /* * successful reads are decrypted by the worker thread */ - if ((bio_data_dir(bio) == READ) - && bio_flagged(bio, BIO_UPTODATE)) { + if (bio_data_dir(io->bio) == READ && !error) { kcryptd_queue_io(io); return 0; }