[PATCH] device-mapper: Trigger an event when a table is deleted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

From: "goggin, edward" <[email protected]>
Signed-Off-By: Alasdair G Kergon <[email protected]>

Index: linux-2.6.14-rc2/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.14-rc2.orig/drivers/md/dm-ioctl.c	2005-09-20 04:00:41.000000000 +0100
+++ linux-2.6.14-rc2/drivers/md/dm-ioctl.c	2005-09-26 22:36:37.000000000 +0100
@@ -230,11 +230,20 @@
 
 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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux