Skip to contentSkip to conversation

2.5.59-rmk-pxa1 and JFFS2 CRC problems

DISCUSSION Russell King 1 participant 1 message May 9, 2003

lore
Share & tools
lore
#0 lore raw

There appears to be a long standing problem with jffs2 which causes CRC errors, and therefore causes various updates (via the setattr filesystem method) to jffs2 filesystems to be ignored.

I have confirmed that this patch does fix the stated problem.

----- Forwarded message from David Woodhouse <[email protected]> -----
From: Frank Becker <[email protected]>
To: [email protected]
CC: [email protected], [email protected]
Date: Mon, 07 Apr 2003 09:58:27 -0700
Subject: Re: 2.5.59-rmk-pxa1 and JFFS2 CRC problems

Quoted 13 lines · [email protected] wrote:
Quoted 4 lines
Quoted 3 lines

Hi all!

I got some errors at jffs2. Please look after creating MTD partitions. We we

Quoted 8 lines

Your message seems corrupted in some way. Did one of the lines exceed 80 characters or something, or did you not actually finish the sentence starting 'We we' ?

Quoted 1 line

jffs2_scan_dirent_node(): Name CRC failed on node at 0x000001cc: Read 0xd3d6f4fb, calculated 0xaff4c1a6

Usually caused by someone screwing up the alignment fixups.

Quoted 8 lines

Sorry for my bad english - Right is:

"BEFORE WE" have switched from 2.5.30 to 2.5.59 jffs2 worked fine.

At the time we have switched from gcc 2.95.03 to gcc 3.2.2. This seems to be better but not good enough. The above error is also reported but "root" is not destroyed. Next step is to have a look to the patches of 2.5.60 to 2.5.65.

I don't have any idea which alignment fixups we could have smashed.

Long lines aside, jffs2 has been broken for me since 2.5.49. I dug in yesterday and it turns out some of the inode fields aren't initialized when doing a jffs2_setattr.

Try the attached patch and see if it makes a difference.

It appear that mtd cvs does the proper initialization. i.e. looks like a merge error in Linus' tree...

Cheers,

Signature · 23 lines
Frank Becker - Intrinsyc Software, Inc. - http://www.intrinsyc.com/
Need a break? http://criticalmass.sf.net/

diff -ruN linux-2.5.65-rmk1/fs/jffs2/file.c linux-2.5.65-rmk1-cerf1/fs/jffs2/file.c
--- linux-2.5.65-rmk1/fs/jffs2/file.c	2003-03-17 13:44:50.000000000 -0800
+++ linux-2.5.65-rmk1-cerf1/fs/jffs2/file.c	2003-04-06 23:08:25.000000000 -0700
@@ -165,6 +165,10 @@
 	ri->mtime = cpu_to_je32((ivalid & ATTR_MTIME)?iattr->ia_mtime.tv_sec:inode->i_mtime.tv_sec);
 	ri->ctime = cpu_to_je32((ivalid & ATTR_CTIME)?iattr->ia_ctime.tv_sec:inode->i_ctime.tv_sec);
 	ri->compr = JFFS2_COMPR_NONE;
+
+	ri->offset = cpu_to_je32(0);;
+	ri->csize = ri->dsize = cpu_to_je32(mdatalen);
+
 	if (ivalid & ATTR_SIZE && inode->i_size < iattr->ia_size) {
 		/* It's an extension. Make it a hole node */
 		ri->compr = JFFS2_COMPR_ZERO;

----- End forwarded message -----

-- 
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html