From b28dfc0655e94f823007ec702ed46c4ba2862c44 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Wed, 19 Sep 2001 14:54:44 +0000 Subject: [PATCH] o Fixed a bug where we were not holding a reference of the block devices used by the targets correctly. --- driver/device-mapper/dm-blkdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/driver/device-mapper/dm-blkdev.c b/driver/device-mapper/dm-blkdev.c index 31a4906d7..f2e6960ae 100644 --- a/driver/device-mapper/dm-blkdev.c +++ b/driver/device-mapper/dm-blkdev.c @@ -107,6 +107,7 @@ static struct block_device *dm_get_device(struct block_device *bdev) if (!d) { rv = blkdev_get(bdev, FMODE_READ | FMODE_WRITE, 0, BDEV_FILE); if (rv == 0) { + atomic_inc(&bdev->bd_count); write_lock(&bdev_lock); list_add(&n->list, &bdev_hash[hash]); d = n; @@ -181,6 +182,7 @@ static void dm_blkdev_drop(struct dm_bdev *d) write_unlock(&bdev_lock); if (d) { blkdev_put(d->bdev, BDEV_FILE); + bdput(d->bdev); kmem_cache_free(bdev_cachep, d); } up(&bdev_sem);