Bug in JFFS

Alexander Larsson alex at cendio.se
Fri Jun 16 13:01:34 EDT 2000


On Fri, 16 Jun 2000, Sébastien Côté wrote:

> I have just found a bug in my port of JFFS (2.2).
> If I mount a filesystem, do 'echo "Test" >> file' (file is an existing
> text file), the file gets appended correctly.  However, once I open the
> file (cat file), the append I do next will not appear on the screen but
> the file size changes correctly.

Ok. Here's how this should be fixed:
We should use generic_file_write in jffs_file_operations instead of
jffs_write_file. Then we should implement writepage, prepare_write and 
commit_write in address_space_operations. These should look quite like
jffs_write_file, so this wouldn't be hard.

There is one problem here though. For each write the page of the file that
is modified is read in, modified and written out in its entierty. This
means several small writes to a file will become several 4Kb writes to the
log.

Another doubt i have here is the log semantics given the page cache. I
don't know if the page cache immediately does the writes or if it delays
them (for better performance or something). That could possibly disturb
the integrity of the log.

/ Alex




To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list