This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: jffs2 fix for small flash disks
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Thu, 29 Apr 2004 08:17:55 +0100
- Subject: Re: jffs2 fix for small flash disks
- References: <1082380418.14501.10.camel@famine>
Øyvind Harboe wrote:
Index: current/src/build.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/build.c,v
retrieving revision 1.5
diff -a -u -w -r1.5 build.c
--- current/src/build.c 20 Nov 2003 16:52:36 -0000 1.5
+++ current/src/build.c 19 Apr 2004 13:11:54 -0000
@@ -259,6 +259,14 @@
c->resv_blocks_write = c->resv_blocks_deletion + (size / c->sector_size);
+ // If the flash disk is smaller than resv_blocks_write, then we
+ // allow writing to the disk anyway. The flash disk is then most likely
+ // being used as write once - read many medimum, e.g. configuration of
+ // static paramters.
+ if (c->resv_blocks_write * c->sector_size > c->flash_size) {
+ c->resv_blocks_write = 0;
+ }
+
/* When do we let the GC thread run in the background */
c->resv_blocks_gctrigger = c->resv_blocks_write + 1;
Hi Øyvind,
You need to submit this to the jffs2 project
<http://sources.redhat.com/jffs2/>. I've applied it for now in the ecos
tree, but the next merge from the upstream master jffs2 sources will
overwrite it if you don't get it applied there.
I suspect they may want to at least issue a warning in this situation though.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine