From: Adam Wozniak <adam.wozniak@comdev.cc>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: debugging strategies for jffs2
Date: Fri, 01 Feb 2002 15:18:30 -0800 [thread overview]
Message-ID: <3C5B2246.2ABBCEFD@comdev.cc> (raw)
In-Reply-To: 4597.1012605105@redhat.com
David Woodhouse wrote:
>
> adam.wozniak@comdev.cc said:
> > > The interesting bit to me is that the csize is 0x0000c000
> > > and the dsize is 0x00000000. Is this perhaps causing problems?
> >
> > At fs/jffs2/gc.c,v 1.52, line 460:
> > fill:
> > ri.magic = JFFS2_MAGIC_BITMASK;
> > ri.nodetype = JFFS2_NODETYPE_INODE;
> > ri.totlen = sizeof(ri);
> > ri.hdr_crc = crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4);
> > ri.ino = inode->i_ino;
> > ri.version = ++f->highest_version;
> > ri.offset = start;
> > ri.csize = end - start;
> > ri.dsize = 0;
> > ri.compr = JFFS2_COMPR_ZERO;
>
> > This seems backwards to me. Shouldn't ri.dsize = end-start and
> > ri.csize = 0 ???
>
> Eep, yes that would probably do it. Well spotted. That obviously wasn't one
> of my more coherent days :)
>
> I've fixed it in v1.61 and v1.52.2.1 (on jffs2-2_4-branch) now - don't chuck
> your filesystem away though, I'll implement a workaround and ask you to test
> it.
Here's the workaround I came up with:
in scan.c:
/* FIXME: Why do we believe totlen? */
DIRTY_SPACE(4);
*ofs += 4;
return 0;
}
// TODO WOZ FIXED
/* older code confused dsize and csize in some cases, fix that
here */
if (ri.dsize == 0 && ri.compr == JFFS2_COMPR_ZERO)
{
ri.dsize = ri.csize;
ri.csize = 0;
ri.node_crc = crc32(0, &ri, sizeof(ri)-8);
}
if (ri.csize) {
/* Check data CRC too */
unsigned char *dbuf;
__u32 crc;
--Adam
--
Adam Wozniak (KG6GZR) COM DEV Wireless - Digital and Software Systems
awozniak@comdev.cc 3450 Broad St. 107, San Luis Obispo, CA 93401
http://www.comdev.cc
Voice: (805) 544-1089 Fax: (805) 544-2055
next prev parent reply other threads:[~2002-02-01 23:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-01 14:24 Fwd: Re: JFFS XConfig David Mackay
2002-02-01 15:11 ` David Woodhouse
2002-02-01 17:33 ` debugging strategies for jffs2 Adam Wozniak
2002-02-01 18:04 ` David Woodhouse
2002-02-01 18:34 ` Adam Wozniak
2002-02-01 19:38 ` David Woodhouse
2002-02-01 19:44 ` Adam Wozniak
2002-02-01 21:40 ` Adam Wozniak
2002-02-01 23:11 ` David Woodhouse
2002-02-01 23:18 ` Adam Wozniak [this message]
2002-02-01 23:30 ` David Woodhouse
2002-02-01 23:41 ` Adam Wozniak
2004-12-17 3:24 ` PATCH to help understanding Charles Manning
2004-12-20 6:59 ` Thomas Gleixner
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=3C5B2246.2ABBCEFD@comdev.cc \
--to=adam.wozniak@comdev.cc \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.