1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

o Fixed a bug where we were not holding a reference of the block devices

used by the targets correctly.
This commit is contained in:
Steven Whitehouse 2001-09-19 14:54:44 +00:00
parent ec3c205f2d
commit b28dfc0655

View File

@ -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);