Block device emulation on top of ubi volumes with read/write support

Richard Weinberger richard at nod.at
Wed Jan 20 14:39:46 PST 2016


Am 20.01.2016 um 22:50 schrieb Ezequiel Garcia:
> On 20 January 2016 at 18:33, Charles Godson <cestgodson at gmail.com> wrote:
>> Hi Ezequiel,
>>
>> Hope this email finds you well.
>>
>> I could have sent this directly to linux-kernel at vger.kernel.org or
>> linux-mtd at lists.infradead.org, but I thought there may be a quick answer to
>> this one.
>>
> 
> I'm Ccing linux-mtd, and some interested folks.
> 
>> I am looking into enabling ext4 support on top of NAND flash. I am currently
>> using squashfs on top of UBI volumes (with your read-only block device
>> emulation), and that works exceptionally well for me (thanks for the quality
>> code!).
>>
>> I've looked at your earlier work, where you started with block device
>> emulation with RW support (e.g. https://lwn.net/Articles/525957/). I haven't
>> seen much progress there, and in 2014 you''ve introduced RO version.
>>
>> I was wondering why the switch?
>>
> 
> I guess there are two reasons: first, because even though UBI
> does wear-leveling, we feared [1] that a regular filesystem would wear out
> blocks by doing a crazy amount of writes.
> 
> To be honest, it wasn't the main obstacle, so I added the
> write-support as an option
> with a big fat warning message. It was later asked to drop the option,
> and I fell for the
> safer read-only instead of leaving write support there.

Yes. UBI is *not* a FTL and doing a proper RW block driver on top of UBI
will be hard. Especially if you want decent performance, power cut tolerance
and a good lifetime of your NAND.

We have UBIFS for reasons. :-)

> The read-only version was much much simpler, and it was tempting to keep things
> simple. This is the second reason.
> 
> You may restart this discussion, write support and see how it goes. I'm not
> entirely opposed to the idea.
> 
> BTW, why can't you just use UBIFS instead?

Please use UBIFS. Are you missing some ext4 feature?

Thanks,
//richard



More information about the linux-mtd mailing list