public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* MTD/JFFS2 bug - misreported filesystem usage
@ 2003-09-30 23:19 Cam Mayor
  2003-09-30 23:25 ` David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: Cam Mayor @ 2003-09-30 23:19 UTC (permalink / raw)
  To: a-linux-mtd

hi all,

I found a reproducable bug in the version of mtd/jffs2 that i have.  I'm 
using kernel 2.4.19-rmk7, and an MTD snapshot from March 25/2003.  My 'df' 
command comes from busybox version 0.60.5.

Bug: misreported filesystem usage

Procedure to reproduce:
1) boot system (this unlocks a NOR flash MTD area on which JFFS2 gets mounted)
2) 'df' to see filesystem usage
3) umount jffs2 partition
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
7) write a file to JFFS2 filesystem
8) 'df' to see filesystem usage
	The filesystem usage is now reported accurately.



-- 
Cameron Mayor
Iders Incorporated

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: MTD/JFFS2 bug - misreported filesystem usage
  2003-09-30 23:19 MTD/JFFS2 bug - misreported filesystem usage Cam Mayor
@ 2003-09-30 23:25 ` David Woodhouse
  0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2003-09-30 23:25 UTC (permalink / raw)
  To: Cam Mayor; +Cc: a-linux-mtd

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
rise...

-- 
dwmw2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-30 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-30 23:19 MTD/JFFS2 bug - misreported filesystem usage Cam Mayor
2003-09-30 23:25 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox