MTD/JFFS2 bug - misreported filesystem usage

David Woodhouse dwmw2 at
Tue Sep 30 19:25:11 EDT 2003

On Tue, 2003-09-30 at 18:19 -0500, Cam Mayor wrote:

> 4) erase mtd partition which had jffs2 filesystem
> 5) mount jffs2 on newly erased partition
> 6) 'df' to see filesystem usage.
> 	"Used" and "Available" fields are switched; switch is reflected in the 
> "Use%" field

We make crap up in statfs().

In particular, we account erasing but not-yet-erased blocks as
unavailable, since the erase may fail. After mounting a newly-erased
device, JFFS2 sticks every single erase block on the list to be erased,
and that's why the space accounting goes haywire. It's not assuming that
any of those erases will succeed until such time as they actually do.

After mounting, just keep running 'df' and watching the free space


More information about the linux-mtd mailing list