Re: [PATCH] EVMS core (3/9) discover.c

From: Andi Kleen (ak@suse.de)
Date: Thu Oct 10 2002 - 15:48:42 EST


Kevin Corry <corryk@us.ibm.com> writes:

> + list_for_each_entry(plugin, &plugin_head, headers) {
> + if (GetPluginType(plugin->id) == EVMS_DEVICE_MANAGER) {
> + spin_unlock(&plugin_lock);
> + DISCOVER(plugin, disk_list);
> + spin_lock(&plugin_lock);
> + }

How do you know "plugin" and its successors are still valid when retaking
the spinlock? Looks like you need a reference count on the object here.

Similar with other functions.

> +
> + if (!gd) {
> + gd = alloc_disk();
> + BUG_ON(!gd);

BUG_ON ? Can't this fail for legal reasons?

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:39 EST