[PATCH 2.6.35] mtd: blktrans: Move device and module ref-counting back to open/release

Maxim Levitsky maximlevitsky at gmail.com
Sun Jul 25 03:41:07 EDT 2010


On Sat, Jul 24, 2010 at 8:03 PM, Ben Hutchings
<bhutchings at solarflare.com> wrote:
> OK, I get it.  Maybe that should be deferred to a work item.
>

I thought about that too.
It doesn't solve the races, because now the deferred work races with
device removal, just like the function that adds new mtd device.
Unless it takes mtd_table_mutex....



> This only works if the MTD itself is hotplugged, and not if the MTD's
> parent is hotplugged.  In fixing one case you have broken the other.

Why?

In my case the mtd device does have a parent, a pci device.
If pci device is removed, I just remove the mtd device from the pci driver.
 (although this codepath it untested)



More information about the linux-mtd mailing list