[PATCH] Make the mtdblock read/write skip the bad nand sector
Brian Norris
computersforpeace at gmail.com
Tue Dec 10 02:43:47 EST 2013
On Fri, Nov 29, 2013 at 02:26:53PM +0100, Pavel Machek wrote:
> > > > Thanks a lot for the insight. After reading this, I'm wondering what's
> > > > preventing us from killing MTD block support altogether. Artem, already
> > > > suggested it a while back...
> > >
> > > People using squashfs/cramfs/readonly ext2/.. on a NOR flash?
> >
> > And people who *still*, after all these years, don't realise that they
> > don't actually need it to mount JFFS2. Even as the root file system
> > (although they *do* need rootfstype=jffs2).
>
> I must admit I'm such person...
Even the Kconfig disagrees with David :)
config MTD_BLOCK
tristate "Caching block device access to MTD devices"
...
At the moment, it is also required for the Journalling Flash File
System(s) to obtain a handle on the MTD device when it's mounted
(although JFFS and JFFS2 don't actually use any of the functionality
of the mtdblock device).
The website is more forthcoming, but it still says it's needed for the
rootfs:
http://linux-mtd.infradead.org/faq/jffs2.html#L_mtdblock
So I suppose we really need to clean this up, eh?
...
> (Should not mtdblock be at least in devices.txt file?)
Probably.
> BTW... is there documentation of mtdblock "translation layer"
> somewhere? I realize it is very simple, but it does need to keep some
> data?
There's a bit scattered around the MTD website, but this FAQ has a
little:
http://linux-mtd.infradead.org/faq/general.html#L_ext2_mtd
Really, the "translation" is truly dead simple; I believe it is simply
an identity mapping, where the mtd is mapped linearly to the mtdblock.
So address X in /dev/mtdY is address X in /dev/mtdblockY.
> I guess running jffs on regular block device (USB stick, SD card) is
> not feasible?
http://linux-mtd.infradead.org/faq/jffs2.html#L_stick_jffs2
Brian
More information about the linux-mtd
mailing list