Re: [PATCH 01/17] MTD: create lockless versions of{get,put}_mtd_device This will be used to resolve deadlock in blocktranslation layer.

From: Maxim Levitsky
Date: Wed Feb 10 2010 - 16:25:07 EST


On Tue, 2010-02-09 at 19:46 +0200, Maxim Levitsky wrote:
> On Tue, 2010-02-09 at 19:23 +0200, Maxim Levitsky wrote:
> > On Tue, 2010-02-09 at 18:14 +0100, Peter Zijlstra wrote:
> > > On Tue, 2010-02-09 at 18:57 +0200, Maxim Levitsky wrote:
> > > > These functions can be used as long as we don't need access to global mtd table, but have
> > > > a pointer to the mtd device.
> > > >
> > > > Signed-off-by: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
> > > > ---

David, I just got a great idea how to resolve the same issue in much
cleaner way.

Why not to drop the mtd table lock before calling the add notifers?
If we assume no add_mtd_device/del_mtd_device running concurrently this
should be ok. After all mtd table lock should protect only the mtd
table.
And the table only purpose it to locate an mtd device by number or name.
This purpose will always be useful, be it a static table or not.

I also remove all that mtd table junk from mtd_blktrans.c

Best regards,
Maxim Levitsky

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