summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_target_zero.c
diff options
context:
space:
mode:
authorhaad <haad@NetBSD.org>2009-02-19 23:07:32 +0000
committerhaad <haad@NetBSD.org>2009-02-19 23:07:32 +0000
commit17599f37f30989c9b5031c73f1c170f363299b72 (patch)
tree843308771fc90d128f9a43d513d8eb17cbb296e2 /sys/dev/dm/dm_target_zero.c
parent7184d23274d3c615121a34f168cf65f51157e9c5 (diff)
Add support for autoloading of device-mapper targets modules. Add
dm_target_autoload function which tries to load target module. Fix two deadlocks in dm_table_load_ioctl error path(I forgot to call dm_dev_unbusy).
Diffstat (limited to 'sys/dev/dm/dm_target_zero.c')
-rw-r--r--sys/dev/dm/dm_target_zero.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/dm/dm_target_zero.c b/sys/dev/dm/dm_target_zero.c
index ff6210dea6e..0011bfd0370 100644
--- a/sys/dev/dm/dm_target_zero.c
+++ b/sys/dev/dm/dm_target_zero.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_target_zero.c,v 1.6 2009/01/14 00:56:15 haad Exp $ */
+/* $NetBSD: dm_target_zero.c,v 1.7 2009/02/19 23:07:33 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,9 +62,10 @@ dm_target_zero_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
- if ((dmt = dm_target_lookup("zero")) != NULL)
+ if ((dmt = dm_target_lookup("zero")) != NULL){
+ dm_target_unbusy(dmt);
return EEXIST;
-
+ }
dmt = dm_target_alloc("zero");
dmt->version[0] = 1;