File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1102,22 +1102,24 @@ static void crypt_endio(struct bio *clone)
11021102 struct dm_crypt_io * io = clone -> bi_private ;
11031103 struct crypt_config * cc = io -> cc ;
11041104 unsigned rw = bio_data_dir (clone );
1105+ int error ;
11051106
11061107 /*
11071108 * free the processed pages
11081109 */
11091110 if (rw == WRITE )
11101111 crypt_free_buffer_pages (cc , clone );
11111112
1113+ error = clone -> bi_error ;
11121114 bio_put (clone );
11131115
1114- if (rw == READ && !clone -> bi_error ) {
1116+ if (rw == READ && !error ) {
11151117 kcryptd_queue_crypt (io );
11161118 return ;
11171119 }
11181120
1119- if (unlikely (clone -> bi_error ))
1120- io -> error = clone -> bi_error ;
1121+ if (unlikely (error ))
1122+ io -> error = error ;
11211123
11221124 crypt_dec_pending (io );
11231125}
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ static void endio(struct bio *bio)
138138{
139139 struct io * io ;
140140 unsigned region ;
141+ int error ;
141142
142143 if (bio -> bi_error && bio_data_dir (bio ) == READ )
143144 zero_fill_bio (bio );
@@ -147,9 +148,10 @@ static void endio(struct bio *bio)
147148 */
148149 retrieve_io_and_region_from_bio (bio , & io , & region );
149150
151+ error = bio -> bi_error ;
150152 bio_put (bio );
151153
152- dec_count (io , region , bio -> bi_error );
154+ dec_count (io , region , error );
153155}
154156
155157/*-----------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -4756,6 +4756,7 @@ static void raid5_align_endio(struct bio *bi)
47564756 struct mddev * mddev ;
47574757 struct r5conf * conf ;
47584758 struct md_rdev * rdev ;
4759+ int error = bi -> bi_error ;
47594760
47604761 bio_put (bi );
47614762
@@ -4766,7 +4767,7 @@ static void raid5_align_endio(struct bio *bi)
47664767
47674768 rdev_dec_pending (rdev , conf -> mddev );
47684769
4769- if (!bi -> bi_error ) {
4770+ if (!error ) {
47704771 trace_block_bio_complete (bdev_get_queue (raid_bi -> bi_bdev ),
47714772 raid_bi , 0 );
47724773 bio_endio (raid_bi );
Original file line number Diff line number Diff line change @@ -459,12 +459,14 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio)
459459{
460460 struct bio_vec * bvec ;
461461 unsigned i ;
462+ int err ;
462463
463464 if (bio -> bi_error )
464465 dio -> io_error = - EIO ;
465466
466467 if (dio -> is_async && dio -> rw == READ ) {
467468 bio_check_pages_dirty (bio ); /* transfers ownership */
469+ err = bio -> bi_error ;
468470 } else {
469471 bio_for_each_segment_all (bvec , bio , i ) {
470472 struct page * page = bvec -> bv_page ;
@@ -473,9 +475,10 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio)
473475 set_page_dirty_lock (page );
474476 page_cache_release (page );
475477 }
478+ err = bio -> bi_error ;
476479 bio_put (bio );
477480 }
478- return bio -> bi_error ;
481+ return err ;
479482}
480483
481484/*
You can’t perform that action at this time.
0 commit comments