From: Florian Schirmer <jolt@tuxbox.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: JFFS2 corruption
Date: Sun, 8 Feb 2004 12:38:44 +0100 [thread overview]
Message-ID: <200402081238.45099.jolt@tuxbox.org> (raw)
In-Reply-To: <1076236627.12587.212.camel@imladris.demon.co.uk>
Hi,
> > i'm having a strange problem with a JFFS2 filesystem: I always get
> > messages about incorrect CRC values while mounting the filesystem. What i
> > did:
>
> Please set CONFIG_JFFS2_FS_DEBUG=1, then reproduce this with full
> logging -- you'll need to do it over a serial console to make sure you
> catch everything.
Thanks for your suggestion. I'm a little bit further finding this problem. It
turns out to be a cmdset2 issue and not a jffs2 problem. I'm still digging
what is going on.
What i've got so far is: jffs2_read_flash returns bogous data. In the case of
a bad crc the last odd byte is wrong. Looks like a byte access instead of a
word access. (Buswidth of the flash: 2) If you look at this:
<7>Node at 000bfbd4 (0) is a data node
<7>version 269, highest_version now 274
<4>crc'ing unpointed
<4>Node data dump (66 bytes)
<4>0x0000: 0x78 (0x78)
<4>0x0001: 0x5E (0x5E)
<4>0x0002: 0x72 (0x72)
<4>0x0003: 0x72 (0x72)
<4>0x0004: 0x1A (0x1A)
<4>0x0005: 0x05 (0x05)
<4>0x0006: 0xA3 (0xA3)
<4>0x0007: 0x21 (0x21)
<4>0x0008: 0x30 (0x30)
<4>0x0009: 0x1A (0x1A)
<4>0x000A: 0x02 (0x02)
<4>0x000B: 0xC3 (0xC3)
<4>0x000C: 0x31 (0x31)
<4>0x000D: 0x04 (0x04)
<4>0x000E: 0x00 (0x00)
<4>0x000F: 0x02 (0x02)
<4>0x0010: 0x68 (0x68)
<4>0x0011: 0xD4 (0xD4)
<4>0x0012: 0x4F (0x4F)
<4>0x0013: 0xA3 (0xA3)
<4>0x0014: 0x21 (0x21)
<4>0x0015: 0x30 (0x30)
<4>0x0016: 0x1A (0x1A)
<4>0x0017: 0x02 (0x02)
<4>0x0018: 0xC3 (0xC3)
<4>0x0019: 0x23 (0x23)
<4>0x001A: 0x04 (0x04)
<4>0x001B: 0x00 (0x00)
<4>0x001C: 0x02 (0x02)
<4>0x001D: 0x68 (0x68)
<4>0x001E: 0xD4 (0xD4)
<4>0x001F: 0x17 (0x17)
<4>0x0020: 0xA3 (0xA3)
<4>0x0021: 0x21 (0x21)
<4>0x0022: 0x30 (0x30)
<4>0x0023: 0x1A (0x1A)
<4>0x0024: 0x02 (0x02)
<4>0x0025: 0x43 (0x43)
<4>0x0026: 0x36 (0x36)
<4>0x0027: 0x04 (0x04)
<4>0x0028: 0x00 (0x00)
<4>0x0029: 0x02 (0x02)
<4>0x002A: 0x68 (0x68)
<4>0x002B: 0xD4 (0xD4)
<4>0x002C: 0xE1 (0xE1)
<4>0x002D: 0xA3 (0xA3)
<4>0x002E: 0x21 (0x21)
<4>0x002F: 0x30 (0x30)
<4>0x0030: 0x1A (0x1A)
<4>0x0031: 0x02 (0x02)
<4>0x0032: 0x43 (0x43)
<4>0x0033: 0x29 (0x29)
<4>0x0034: 0x04 (0x04)
<4>0x0035: 0x00 (0x00)
<4>0x0036: 0x02 (0x02)
<4>0x0037: 0x68 (0x68)
<4>0x0038: 0x84 (0x84)
<4>0x0039: 0xB8 (0xB8)
<4>0x003A: 0x15 (0x15)
<4>0x003B: 0x20 (0x20)
<4>0x003C: 0xC0 (0xC0)
<4>0x003D: 0x00 (0x00)
<4>0x003E: 0x0F (0x0F)
<4>0x003F: 0x3C (0x3C)
<4>0x0040: 0x20 (0x20)
<4>0x0041: 0x20 (0x3D)
<5>jffs2_get_inode_nodes(): Data CRC failed on node at 0x000bfbd4: Read
0xc073b413, calculated 0xa375d8ca
<7>Obsoleting previously unchecked node at 0x000bfbd4 of len 88: Dirtying
you will see that the last byte (offset 0x41) mirrors byte at offset 0x40. So
i suspect a bug in the cmdset2 driver here. The third value is the value
received by directly accessing the flash using the memory address and is
always correct. If the node data size is odd then the 2nd byte from behind is
affected:
<4>0x002F: 0x0F (0x0F)
<4>0x0030: 0x3C (0x3C)
<4>0x0031: 0x3C (0x20)
<4>0x0032: 0x3D (0x3D)
Am still collecting patterns to determine wether it is really a bug in the mtd
core or just a cache issue or whatever.
BTW: Is %zd a leagal printk formatting tag? Doesn't seem to work for me. I can
commit a fix (removing the z) for that if you want.
Regards,
Florian
next prev parent reply other threads:[~2004-02-08 11:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-05 13:15 JFFS2 corruption Florian Schirmer
2004-02-08 10:37 ` David Woodhouse
2004-02-08 11:38 ` Florian Schirmer [this message]
2004-02-08 11:53 ` David Woodhouse
2004-02-08 17:02 ` Florian Schirmer
2004-02-08 17:13 ` David Woodhouse
2004-02-08 11:28 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2004-02-19 16:48 JFFS2 Corruption simon
2004-02-23 11:07 ` simon
2004-02-24 9:48 ` simon
2004-02-24 12:00 ` David Woodhouse
2004-02-24 12:54 ` Simon Haynes
2004-02-24 13:04 ` Simon Haynes
2004-02-24 13:40 ` Simon Haynes
2004-02-24 14:22 ` David Woodhouse
2004-02-24 14:25 ` Simon Haynes
2004-02-24 14:56 ` David Woodhouse
2004-02-24 14:58 ` Simon Haynes
2004-02-24 15:35 ` David Woodhouse
2004-02-24 15:47 ` Simon Haynes
2004-02-24 16:14 ` David Woodhouse
2004-02-24 16:17 ` Simon Haynes
2004-02-24 16:51 ` David Woodhouse
2004-02-24 17:05 ` Simon Haynes
2004-02-24 18:05 ` David Woodhouse
2004-02-24 18:04 ` Simon Haynes
2004-02-25 9:49 ` simon
2004-02-25 10:25 ` David Woodhouse
2004-02-26 11:08 ` Simon Haynes
2004-02-26 11:55 ` David Woodhouse
2004-03-03 15:31 ` David Woodhouse
2004-03-08 15:10 ` Simon Haynes
2004-03-09 15:33 ` Simon Haynes
2004-03-16 16:14 ` David Woodhouse
2004-03-19 10:37 ` Simon Haynes
2004-03-19 11:11 ` David Woodhouse
2004-02-24 17:12 ` Simon Haynes
2004-02-24 16:55 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200402081238.45099.jolt@tuxbox.org \
--to=jolt@tuxbox.org \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox