diff options
| -rw-r--r-- | drivers/md/dm-cache-target.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 66120bd46d15..1ab122a75764 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include "dm.h" | 7 | #include "dm.h" |
| 8 | #include "dm-bio-prison.h" | 8 | #include "dm-bio-prison.h" |
| 9 | #include "dm-bio-record.h" | ||
| 9 | #include "dm-cache-metadata.h" | 10 | #include "dm-cache-metadata.h" |
| 10 | 11 | ||
| 11 | #include <linux/dm-io.h> | 12 | #include <linux/dm-io.h> |
| @@ -205,6 +206,7 @@ struct per_bio_data { | |||
| 205 | struct cache *cache; | 206 | struct cache *cache; |
| 206 | dm_cblock_t cblock; | 207 | dm_cblock_t cblock; |
| 207 | bio_end_io_t *saved_bi_end_io; | 208 | bio_end_io_t *saved_bi_end_io; |
| 209 | struct dm_bio_details bio_details; | ||
| 208 | }; | 210 | }; |
| 209 | 211 | ||
| 210 | struct dm_cache_migration { | 212 | struct dm_cache_migration { |
| @@ -643,6 +645,7 @@ static void writethrough_endio(struct bio *bio, int err) | |||
| 643 | return; | 645 | return; |
| 644 | } | 646 | } |
| 645 | 647 | ||
| 648 | dm_bio_restore(&pb->bio_details, bio); | ||
| 646 | remap_to_cache(pb->cache, bio, pb->cblock); | 649 | remap_to_cache(pb->cache, bio, pb->cblock); |
| 647 | 650 | ||
| 648 | /* | 651 | /* |
| @@ -667,6 +670,7 @@ static void remap_to_origin_then_cache(struct cache *cache, struct bio *bio, | |||
| 667 | pb->cache = cache; | 670 | pb->cache = cache; |
| 668 | pb->cblock = cblock; | 671 | pb->cblock = cblock; |
| 669 | pb->saved_bi_end_io = bio->bi_end_io; | 672 | pb->saved_bi_end_io = bio->bi_end_io; |
| 673 | dm_bio_record(&pb->bio_details, bio); | ||
| 670 | bio->bi_end_io = writethrough_endio; | 674 | bio->bi_end_io = writethrough_endio; |
| 671 | 675 | ||
| 672 | remap_to_origin_clear_discard(pb->cache, bio, oblock); | 676 | remap_to_origin_clear_discard(pb->cache, bio, oblock); |
