Skip to contentSkip to conversation

dm table cleanup warning message

PATCH In review Jonathan Brassow 2 participants 3 messages Mar 20, 2009 – May 14, 2009 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm table cleanup warning message

Patch name: dm-table-cleanup-warning-message.patch

Adjust warning message, since there is no dm_table_remove_device which the message references. I found it also helpful to get a message about /which/ device was not dm_put_device'ed.

drivers/md/dm-table.c +4 -2
Index: linux-2.6/drivers/md/dm-table.c
===================================================================
@@ -299,9 +299,11 @@ void dm_table_destroy(struct dm_table *t
 
 	/* free the device list */
 	if (t->devices.next != &t->devices) {
-		DMWARN("devices still present during destroy: "
-		       "dm_table_remove_device calls missing");
+		struct dm_dev_internal *dd;
 
+		DMWARN("dm_put_device calls missing for:");
+		list_for_each_entry(dd, &t->devices, list)
+			DMWARN(" - %s", dd->dm_dev.name);
 		free_devices(&t->devices);
 	}
 
#1 lore raw

drivers/md/dm-table.c void dm_table_destroy(struct dm_table *t · line 306

Quoted 3 lines · Jon Brassow
drivers/md/dm-table.c +3 -0
+		DMWARN("dm_put_device calls missing for:");
+		list_for_each_entry(dd, &t->devices, list)
+			DMWARN(" - %s", dd->dm_dev.name);

The multi-line format is unnecessary there: I'm changing it. (Think what happens if it gets intermingled with other similar-looking multi-line output. Each line of output should make sense in isolation.)

Alasdair

#2 lore raw
In reply to Jonathan Brassow

drivers/md/dm-table.c void dm_table_destroy(struct dm_table *t · line 305

Quoted 1 line · Jon Brassow
drivers/md/dm-table.c +1 -0
+		list_for_each_entry(dd, &t->devices, list)

There's already such a loop - no need for another one.

Alasdair.