[Yaffs] Make YAFFS2 work as a root FS, patch

Peter Barada Peter.B at LogicPD.com
Thu Oct 27 22:17:04 BST 2005


On Thu, 2005-10-27 at 12:58 -0700, Sergey Kubushyn wrote:
> On Thu, 27 Oct 2005, Martin Fouts wrote:
> 
> First of all, please don't take it as an abuse.

It is sure coming across as abuse, no matter how much you claim it
isn't.

> > > > You were, by the way, mistaken.  Linux kernel will mount YAFFS2
> > > > filesystem without it.  However, when the read of the mtd
> > > super struct
> > > > fails, the error returned (EPERM) will be confusing to the end
> > user.
> > >
> > > No, it will not.
> > >
> > > All the filesystems known to the kernel at bootup are tried
> > > in turn. YAFFS comes before YAFFS2 so before YAFFS2 is tried
> > > kernel gets an error from YAFFS that is -1 i.e. -EPERM now.
> > > That breaks the loop and make the kernel panic.
> >
> > Hi Sergey,
> >
> > Guess we got caught in the terminology thing.  To *me* YAFFS2 is
> > version
> > 2 of the YAFFS source code base, which works for both 512 byte and 2k
> > byte page size file systems.  In that sense, YAFFS2 *will* work.
> 
> Yes, this is an acceptable excuse. Barely but acceptable.
> 
> > Also, it is possible to build for 2k devices without building for 512
> > bytes pages.  In that sense, YAFFS2 *will* work.
> 
> Not with the current source. It does NOT build without YAFFS1 support (at
> least it didn't a couple of weeks ago.) And no matter what they both are
> registered with the kernel because of commented out conditionals in CVS
> code.
> 
> Again, nice try but failed.
> 
> > But, you mention reading source code.  Perhaps you should read man
> > pages.  If you specify the -t option to mount, it does not try all file
> > system types, but tries the one you specify, so even if you've built a
> > YAFFS2 file system that handles both 512 byte and 2k devices, you could
> > still mount a 2k device, even with the bug in place.
> 
> OK, please explain how can one mount _ROOT_ filesystem with "mount -t". Try
> to explain where that "mount" comes from if the root FS is not mounted.
> Just to counter a possible excuse and to avoid emailing twice - you do NOT
> mount a _ROOT_ YAFFS (or ext2 or whatever it is) filesystem when booting
> with initrd. That's initrd that contains a root filesystem. You mount the
> other filesystem elsewhere and only then you pivot_root() to it.
> 
> There is only one way to mount the root filesystem. And there is no way to
> tell "-t yaffs2" to the kernel. At least without some unconventional
> trickery.

Try adding the conventional 'trickery' of "rootfstype=yaffs" to your command line...

> > In fact, of the many ways to build and install YAFFS2, there is only
> > one
> > in which it won't mount a file system.  Had you put more information
> > and
> > less vitriol into your email, I would have realized that you were in
> > that one circumstance.  It's hard to read your mind, and your attitude
> > makes it undesirable to try.
> >
> > I mention this, Sergey, because it seems to be the root of your
> > misunderstanding about how fragile YAFFS is.  You seem to think that
> > there is only one way to use a file system -- yours -- and if it breaks
> > when being used that way, it can't work any other way.
> 
> No, I don't. There is only one way to mount a _ROOT_ FS, yes. I simply don't
> understand how else could've I made it more clear.
> 
> > So yes, Sergey, as things stood until your patch, if you tried to use
> > YAFFS2 as the root file system on a 2k NAND device, your kernel
> > wouldn't
> > boot.  Too bad you hadn't thought to tell us that was the set of
> > circumstances you were running under.  Among other things, it would
> > have
> > given me the basis for a test case to add to a regression suite for
> > yaffs.
> 
> Eh... Prove me wrong, but the word "ROOT" is all over my email. And subject
> says _root_ .

Jeez, you say its not abuse, but here we go again.

> > The patch is in my tree.  As soon as I test it, it'll get pushed.  Now
> > that you've taken the time to identify exactly what you were doing,
> > I'll
> > see about making it a test case.  (We don't have 2k parts here at
> > PalmSource, so it will be difficult for me to test.)
> 
> This one is trivial. It DOES work. It doesn't even deserve any special
> mentioning. There are much more serious bugs in YAFFS. Some of them are
> probably fixable although requiring a rework, not just fix (those infamous
> _padded_ structures casted to (char *), (__u8 *) etc. left and right), some
> are probably not (logical errors, design flaws.)
> 
> It is downright stupid to get abused by someone's pushing. If I were so
> easily abused by any rant I would've quit any programming long-long ago and
> shot myself to death with a cucumber. You guys should've watched real rants
> and holy wars in lkml, those are for real... VFS remodelling, DevFS, lot of
> other stuff...

I use YAFFS as a rootfs on a NOR-based system all the time.  And I have
to say its pretty robust(too bad I can't keep the statistics across
boots).  I've written a program that in a loop(5000 times) opens up a
file, appends an ascii number to it, and then closes the file.  This
forces at least two writes to the flash, one to add the data, and the
other to update the i-node.  Then to make things even *more*
interesting, I do it again for another file while keeping the first 5
files around to force much more spread in the footprint.  This I've left
running for days on end, and have achieved many *millions* of writes,
and hundreds of *thousands* of erases.


If you don't like YAFFS, punt it and go away.  If you want to
contribute, write patches and submit them.  If they're good enough, then
you don't have to add a single word of commentary(inflammatory or
otherwise).  If you have a problem, describe the problem well enough
that that others can replicate your problem.

I wonder if you treat your friends with the same attitude you are this
mailing list.  If so, then how do you keep them as friends, or do they
put you in their kill files?

> ---
> ******************************************************************
> *  KSI at home    KOI8 Net  < >  The impossible we do immediately.  *
> *  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
> ******************************************************************
> 
> 
> _______________________________________________
> yaffs mailing list
> yaffs at stoneboat.aleph1.co.uk
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
-- 
Peter Barada <Peter.B at LogicPD.com>




More information about the yaffs mailing list