diff options
author | Jonthan Brassow <jbrassow@redhat.com> | 2009-06-22 05:12:29 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 05:12:29 -0400 |
commit | 1b6da754594e6e26c24e6fbc1a34f9c03e4617a3 (patch) | |
tree | 713b521ab6f0769752c57bebb7c10621abc09cea /drivers/md/dm-table.c | |
parent | f392ba889b019602976082bfe7bf486c2594f85c (diff) |
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: 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 0e2210c0c168..af1ceae2582a 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -267,6 +267,8 @@ static void free_devices(struct list_head *devices) | |||
267 | list_for_each_safe(tmp, next, devices) { | 267 | list_for_each_safe(tmp, next, devices) { |
268 | struct dm_dev_internal *dd = | 268 | struct dm_dev_internal *dd = |
269 | list_entry(tmp, struct dm_dev_internal, list); | 269 | list_entry(tmp, struct dm_dev_internal, list); |
270 | DMWARN("dm_table_destroy: dm_put_device call missing for %s", | ||
271 | dd->dm_dev.name); | ||
270 | kfree(dd); | 272 | kfree(dd); |
271 | } | 273 | } |
272 | } | 274 | } |
@@ -296,12 +298,8 @@ void dm_table_destroy(struct dm_table *t) | |||
296 | vfree(t->highs); | 298 | vfree(t->highs); |
297 | 299 | ||
298 | /* free the device list */ | 300 | /* free the device list */ |
299 | if (t->devices.next != &t->devices) { | 301 | if (t->devices.next != &t->devices) |
300 | DMWARN("devices still present during destroy: " | ||
301 | "dm_table_remove_device calls missing"); | ||
302 | |||
303 | free_devices(&t->devices); | 302 | free_devices(&t->devices); |
304 | } | ||
305 | 303 | ||
306 | kfree(t); | 304 | kfree(t); |
307 | } | 305 | } |