Commit 1b6da754 authored by Jonthan Brassow's avatar Jonthan Brassow Committed by Alasdair G Kergon

dm table: improve warning message when devices not freed before destruction

Report any devices forgotten to be freed before a table is destroyed.
Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent f392ba88
...@@ -267,6 +267,8 @@ static void free_devices(struct list_head *devices) ...@@ -267,6 +267,8 @@ static void free_devices(struct list_head *devices)
list_for_each_safe(tmp, next, devices) { list_for_each_safe(tmp, next, devices) {
struct dm_dev_internal *dd = struct dm_dev_internal *dd =
list_entry(tmp, struct dm_dev_internal, list); 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); kfree(dd);
} }
} }
...@@ -296,12 +298,8 @@ void dm_table_destroy(struct dm_table *t) ...@@ -296,12 +298,8 @@ void dm_table_destroy(struct dm_table *t)
vfree(t->highs); vfree(t->highs);
/* free the device list */ /* free the device list */
if (t->devices.next != &t->devices) { if (t->devices.next != &t->devices)
DMWARN("devices still present during destroy: "
"dm_table_remove_device calls missing");
free_devices(&t->devices); free_devices(&t->devices);
}
kfree(t); kfree(t);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment