summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
authorgoggin, edward2005-09-28 06:45:44 +0200
committerLinus Torvalds2005-09-28 16:46:42 +0200
commit269fd2a6f84828fd96218d164dace8c413fa5c03 (patch)
tree20496da0d4e5c5a6096a0e690b5b603ace6f7baf /drivers/md/dm-ioctl.c
parent[PATCH] swsusp: avoid problems if there are too many pages to save (diff)
downloadkernel-qcow2-linux-269fd2a6f84828fd96218d164dace8c413fa5c03.tar.gz
kernel-qcow2-linux-269fd2a6f84828fd96218d164dace8c413fa5c03.tar.xz
kernel-qcow2-linux-269fd2a6f84828fd96218d164dace8c413fa5c03.zip
[PATCH] device-mapper: Trigger an event when a table is deleted
If anything is waiting on a device's table when the device is removed, we must first wake it up so it will release its reference. Otherwise the table's reference count will not drop to zero and the table will not get removed. Signed-Off-By: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r--drivers/md/dm-ioctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 200a0688f717..54ec737195e0 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -230,11 +230,20 @@ static int dm_hash_insert(const char *name, const char *uuid, struct mapped_devi
static void __hash_remove(struct hash_cell *hc)
{
+ struct dm_table *table;
+
/* remove from the dev hash */
list_del(&hc->uuid_list);
list_del(&hc->name_list);
unregister_with_devfs(hc);
dm_set_mdptr(hc->md, NULL);
+
+ table = dm_get_table(hc->md);
+ if (table) {
+ dm_table_event(table);
+ dm_table_put(table);
+ }
+
dm_put(hc->md);
if (hc->new_map)
dm_table_put(hc->new_map);