From: Jonthan Brassow Report any devices that forgot to be freed before a table is destroyed. Signed-off-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon --- drivers/md/dm-table.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) Index: linux-2.6.30-rc4/drivers/md/dm-table.c =================================================================== --- linux-2.6.30-rc4.orig/drivers/md/dm-table.c +++ linux-2.6.30-rc4/drivers/md/dm-table.c @@ -266,6 +266,8 @@ static void free_devices(struct list_hea list_for_each_safe(tmp, next, devices) { struct dm_dev_internal *dd = list_entry(tmp, struct dm_dev_internal, list); + DMWARN("dm_table_destroy: dm_put_device call missing for %s", + dd->dm_dev.name); kfree(dd); } } @@ -295,12 +297,8 @@ void dm_table_destroy(struct dm_table *t vfree(t->highs); /* free the device list */ - if (t->devices.next != &t->devices) { - DMWARN("devices still present during destroy: " - "dm_table_remove_device calls missing"); - + if (t->devices.next != &t->devices) free_devices(&t->devices); - } kfree(t); }