Commit 41dbbb6e authored by Joe Thornber's avatar Joe Thornber Committed by Linus Torvalds

[PATCH] dm: fix md->pending count

md->pending was being incremented for each clone rather than just
once. [Kevin Corry]
parent 2766fd78
...@@ -310,7 +310,6 @@ static void __map_bio(struct dm_target *ti, struct bio *clone) ...@@ -310,7 +310,6 @@ static void __map_bio(struct dm_target *ti, struct bio *clone)
* anything, the target has assumed ownership of * anything, the target has assumed ownership of
* this io. * this io.
*/ */
atomic_inc(&io->md->pending);
atomic_inc(&io->io_count); atomic_inc(&io->io_count);
r = ti->type->map(ti, clone); r = ti->type->map(ti, clone);
if (r > 0) if (r > 0)
...@@ -424,6 +423,7 @@ static void __split_bio(struct mapped_device *md, struct bio *bio) ...@@ -424,6 +423,7 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
ci.sector_count = bio_sectors(bio); ci.sector_count = bio_sectors(bio);
ci.idx = 0; ci.idx = 0;
atomic_inc(&md->pending);
while (ci.sector_count) while (ci.sector_count)
__clone_and_map(&ci); __clone_and_map(&ci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment