Index: fs/jffs2/build.c =================================================================== RCS file: /home/cvs/mtd/fs/jffs2/build.c,v retrieving revision 1.77 diff -u -r1.77 build.c --- fs/jffs2/build.c 31 Aug 2005 13:51:00 -0000 1.77 +++ fs/jffs2/build.c 2 Sep 2005 12:42:49 -0000 @@ -279,6 +279,18 @@ c->resv_blocks_write = c->resv_blocks_deletion + (size / c->sector_size); + /* It is possible to mount a JFFS2 in a mode where it allows + Write Once Read Many operation if the flash disk is too small + to support read/write many times. + + 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. in-system configuration of + static parameters(e.g. MAC address of device in stored in "ROM"). */ + if ((c->flags & JFFS2_SB_FLAG_ALLOW_WORM)!=0)&& (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; Index: include/linux/jffs2_fs_sb.h =================================================================== RCS file: /home/cvs/mtd/include/linux/jffs2_fs_sb.h,v retrieving revision 1.52 diff -u -r1.52 jffs2_fs_sb.h --- include/linux/jffs2_fs_sb.h 19 May 2005 16:12:17 -0000 1.52 +++ include/linux/jffs2_fs_sb.h 2 Sep 2005 12:42:49 -0000 @@ -16,6 +16,9 @@ #define JFFS2_SB_FLAG_RO 1 #define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */ #define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */ +#define JFFS2_SB_FLAG_ALLOW_WORM 8 /* allow write once read many if the + disk is too small to support read/write + many times*/ struct jffs2_inodirty;