block: add a bi_error field to struct bio
[deliverable/linux.git] / drivers / md / dm-crypt.c
index 0f48fed44a17f6ee9f36967c3be979c1e20fe7b5..744b80c608e55f549fdb73d7cd3d5a9c4f08f333 100644 (file)
@@ -1076,7 +1076,8 @@ static void crypt_dec_pending(struct dm_crypt_io *io)
        if (io->ctx.req)
                crypt_free_req(cc, io->ctx.req, base_bio);
 
-       bio_endio(base_bio, error);
+       base_bio->bi_error = error;
+       bio_endio(base_bio);
 }
 
 /*
@@ -1096,15 +1097,12 @@ static void crypt_dec_pending(struct dm_crypt_io *io)
  * The work is done per CPU global for all dm-crypt instances.
  * They should not depend on each other and do not block.
  */
-static void crypt_endio(struct bio *clone, int error)
+static void crypt_endio(struct bio *clone)
 {
        struct dm_crypt_io *io = clone->bi_private;
        struct crypt_config *cc = io->cc;
        unsigned rw = bio_data_dir(clone);
 
-       if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error))
-               error = -EIO;
-
        /*
         * free the processed pages
         */
@@ -1113,13 +1111,13 @@ static void crypt_endio(struct bio *clone, int error)
 
        bio_put(clone);
 
-       if (rw == READ && !error) {
+       if (rw == READ && !clone->bi_error) {
                kcryptd_queue_crypt(io);
                return;
        }
 
-       if (unlikely(error))
-               io->error = error;
+       if (unlikely(clone->bi_error))
+               io->error = clone->bi_error;
 
        crypt_dec_pending(io);
 }
This page took 0.02662 seconds and 5 git commands to generate.