diff options
author | goggin, edward <egoggin@emc.com> | 2005-09-28 00:45:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-28 10:46:42 -0400 |
commit | 269fd2a6f84828fd96218d164dace8c413fa5c03 (patch) | |
tree | 20496da0d4e5c5a6096a0e690b5b603ace6f7baf /drivers | |
parent | 0f7347c20c410c300be0db4c132945fd02e54110 (diff) |
[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')
-rw-r--r-- | drivers/md/dm-ioctl.c | 9 |
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 | |||
230 | 230 | ||
231 | static void __hash_remove(struct hash_cell *hc) | 231 | static void __hash_remove(struct hash_cell *hc) |
232 | { | 232 | { |
233 | struct dm_table *table; | ||
234 | |||
233 | /* remove from the dev hash */ | 235 | /* remove from the dev hash */ |
234 | list_del(&hc->uuid_list); | 236 | list_del(&hc->uuid_list); |
235 | list_del(&hc->name_list); | 237 | list_del(&hc->name_list); |
236 | unregister_with_devfs(hc); | 238 | unregister_with_devfs(hc); |
237 | dm_set_mdptr(hc->md, NULL); | 239 | dm_set_mdptr(hc->md, NULL); |
240 | |||
241 | table = dm_get_table(hc->md); | ||
242 | if (table) { | ||
243 | dm_table_event(table); | ||
244 | dm_table_put(table); | ||
245 | } | ||
246 | |||
238 | dm_put(hc->md); | 247 | dm_put(hc->md); |
239 | if (hc->new_map) | 248 | if (hc->new_map) |
240 | dm_table_put(hc->new_map); | 249 | dm_table_put(hc->new_map); |