diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-cache-target.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index bf3a206abd78..7c8dd1f69ce0 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -85,6 +85,12 @@ static void dm_unhook_bio(struct dm_hook_info *h, struct bio *bio) | |||
85 | { | 85 | { |
86 | bio->bi_end_io = h->bi_end_io; | 86 | bio->bi_end_io = h->bi_end_io; |
87 | bio->bi_private = h->bi_private; | 87 | bio->bi_private = h->bi_private; |
88 | |||
89 | /* | ||
90 | * Must bump bi_remaining to allow bio to complete with | ||
91 | * restored bi_end_io. | ||
92 | */ | ||
93 | atomic_inc(&bio->bi_remaining); | ||
88 | } | 94 | } |
89 | 95 | ||
90 | /*----------------------------------------------------------------*/ | 96 | /*----------------------------------------------------------------*/ |
@@ -765,12 +771,6 @@ static void writethrough_endio(struct bio *bio, int err) | |||
765 | 771 | ||
766 | dm_unhook_bio(&pb->hook_info, bio); | 772 | dm_unhook_bio(&pb->hook_info, bio); |
767 | 773 | ||
768 | /* | ||
769 | * Must bump bi_remaining to allow bio to complete with | ||
770 | * restored bi_end_io. | ||
771 | */ | ||
772 | atomic_inc(&bio->bi_remaining); | ||
773 | |||
774 | if (err) { | 774 | if (err) { |
775 | bio_endio(bio, err); | 775 | bio_endio(bio, err); |
776 | return; | 776 | return; |