[ECOS] JFFS2: Problem in fs-ecos.c
Andrew Lunn
andrew@lunn.ch
Wed Apr 7 04:25:00 GMT 2004
On Wed, Mar 24, 2004 at 10:47:01AM +0000, eibach@gdsys.de wrote:
> Hello,
>
> in function jffs2_extend_file I find
>
> ri->totlen = cpu_to_je32(sizeof(ri));
>
> and
>
> ri->node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
>
> But ri is only a pointer to a jffs2_raw_inode struct.
>
> So totlen seems to be set incorrect and causes trouble in jffs2_write_dnode.
>
> Am I getting this right? Can it be fixed by replacing sizeof(ri) with sizeof(*ri)?
I think this is now fixed. Attached is the patch i just committed to
CVS. It include a simple test program that seeks past the end of the
file so putting a hole into it. It then closes the file, opens it up
again and reads back the contents checking it contains what is
expected. Its not a particularly thorough test so there could still be
bugs hiding out somewhere.
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jffs2.dif
Type: video/x-dv
Size: 11827 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20040407/53f43127/attachment.bin>
-------------- next part --------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list