Garbage Collection Questions?

David Woodhouse dwmw2 at infradead.org
Mon Dec 14 22:04:43 EST 2009


On Mon, 2009-12-14 at 17:57 -0800, John Harbold wrote:
> 
> 
>             I have some questions on some JFFS2 scenarios running
> Linux kernel 2.6.10. 

There have been serious bugs fixed since then. Update.

>  These scenarios have to do with the state of a JFFS2 partition while
> its associated garbage collection kernel thread is running:
> 
>         * What would happen to a JFFS2 partition after a power failure
> when,    before the power failure happened, the garbage collection
> thread was    obsoleting nodes?

Nodes are only marked as obsolete _after_ a suitable replacement for
them has actually been written out. So the only problem that could occur
here is that you write out a new node, but crash before you manage to
mark the old one obsolete. And we cope with that just fine, marking the
old one obsolete when we remount.

>         * What would happen to a JFFS2 partition if while the
> garbage   collection thread was active and the partition was marked as
> read-      only?  Would the obsolete nodes be obliterated?

We kill the GC thread on remounting read-only. No garbage collection
happens on a read-only file system.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation




More information about the linux-mtd mailing list