]> git.hungrycats.org Git - linux/commitdiff
[PATCH] dm: fix md->pending count
authorJoe Thornber <joe@fib011235813.fsnet.co.uk>
Mon, 16 Dec 2002 01:16:53 +0000 (17:16 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 16 Dec 2002 01:16:53 +0000 (17:16 -0800)
md->pending was being incremented for each clone rather than just
once. [Kevin Corry]

drivers/md/dm.c

index f7cf3b54354336dabbc3f26170c517e0d70a2bf0..0564dcd9611654bf598e8e86e5e9bab318d21f53 100644 (file)
@@ -310,7 +310,6 @@ static void __map_bio(struct dm_target *ti, struct bio *clone)
         * anything, the target has assumed ownership of
         * this io.
         */
-       atomic_inc(&io->md->pending);
        atomic_inc(&io->io_count);
        r = ti->type->map(ti, clone);
        if (r > 0)
@@ -424,6 +423,7 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
        ci.sector_count = bio_sectors(bio);
        ci.idx = 0;
 
+       atomic_inc(&md->pending);
        while (ci.sector_count)
                __clone_and_map(&ci);