Skip to content

Commit

Permalink
[PATCH] device-mapper: Trigger an event when a table is deleted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
goggin, edward authored and Linus Torvalds committed Sep 28, 2005
1 parent 0f7347c commit 269fd2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 269fd2a

Please sign in to comment.