Possible Bug In UFFS?

64 views
Skip to first unread message

Gil Glass

unread,
Oct 24, 2018, 10:51:00 AM10/24/18
to UFFS
Hi Ricky,

I finally have UFFS running in my system!  It has been working very well for all operations... assuming that the file is less than 126,729 bytes in size!

Yes, you read that right!  There's a very strange thing happening when file sizes get over this threshold.  Note that this happens when the file is written in smaller chunks.  The failure is occurring when I try to do a copy operation which is done in 512-byte chunks.  Here is some pseudocode to describe what I'm seeing:

open source file for reading
open target file for writing
repeat until all data from the source file has been read
if there is at least 512 bytes of data left in the source file
pull 512 bytes of data from the source file and write it to the target file
otherwise
pull whatever is left from the source file and write it to the target file
endif
end

As the file size approaches 126,729, the one block needed to hold it gradually fills up.  However, once the size exceeds 126,728, instead of just going another block, UFFS fills up just over half of one block (33 pages) and then fills up the entirety of the next block (64 pages).  Also, the directory entry is full of garbage.

Any idea what could be happening here?  FYI, pages are 2048 bytes, spare is 64 bytes (16 available for tagstore and seal byte), and blocks are 64 pages.

Cheers,
Gil
Reply all
Reply to author
Forward
0 new messages