This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JFFS2: Problem in fs-ecos.c


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)?

Im guessing you are the first person to actually use this section of
code and you are finding all the bugs.

Im not a jffs2 expert, but to me it looks like most of the references
to ri on the lift hand side of an = assume its an pointer and the
references to it on the right hand side of an = assume its a
structure.

I don't think its enough add missing *. You also need to delete some &
i think. You will need to take a careful look at the code and maybe
check with David Woodhouse.

      Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]