Index: build.c =================================================================== RCS file: /home/cvs/mtd/fs/jffs2/build.c,v retrieving revision 1.76 diff -u -r1.76 build.c --- build.c 30 Jul 2005 15:29:27 -0000 1.76 +++ build.c 31 Aug 2005 09:01:34 -0000 @@ -279,6 +279,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. in-system configuration of + static parameters(e.g. MAC address of device in stored in "ROM"). */ + 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;