diff options
author | Jonthan Brassow <jbrassow@redhat.com> | 2009-05-15 09:12:44 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-05-15 09:12:44 +1000 |
commit | 2481dd3116709416027a2d7b1c521789221eba98 (patch) | |
tree | 01b52fd0a95aeb6ebfbbac4f3e2dfb0ba3e93045 /drivers/md/dm-table.c | |
parent | fe19ea9e006efb9d2450ff2ca2419b49edf544bb (diff) |
dm-table-improve-warning-message-when-devices-not-freed-before-destruction
Report any devices that forgot to be freed before a table is destroyed.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 443fd6a1702d..77a88c5ee66d 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -266,6 +266,8 @@ static void free_devices(struct list_head *devices) 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); } |