From: "Øyvind Harboe" <oyvind.harboe@zylin.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org, ecos-discuss@sources.redhat.com
Subject: Re: JFFS2 eats memory
Date: Wed, 21 Jul 2004 08:25:33 +0200 [thread overview]
Message-ID: <1090391133.15766.4.camel@famine> (raw)
In-Reply-To: <1090361318.9473.10.camel@localhost.localdomain>
On Wed, 2004-07-21 at 00:08, David Woodhouse wrote:
> On Tue, 2004-07-20 at 20:52 +0200, Øyvind Harboe wrote:
> > I caught it in gc.c where at some point the code assumes that gc_node
> > does not change beneath it. Don't remember.
>
> Hmmm. That sounds like it could break anyway. Can you be more specific?
1. Set jeb->gc_node = NULL; at the end of jffs2_mark_node_obsolete();
2. fire up the debugger and start writing to the JFFS2 disk.
3. See below...
in gc.c:
240
- 241 if (!raw->next_in_ino) {
242 /* Inode-less node. Clean marker, snapshot or something like
that */
243 /* FIXME: If it's something that needs to be copied, including
something
244 we don't grok that has JFFS2_NODETYPE_RWCOMPAT_COPY, we
should do so */
245 spin_unlock(&c->erase_completion_lock);
- 246 jffs2_mark_node_obsolete(c, raw);
- 247 up(&c->alloc_sem);
- 248 goto eraseit_lock;
249 }
250
----- Here raw == NULL, hence jffs2_raw_ref_to_ic() crashes.
- 251 ic = jffs2_raw_ref_to_ic(raw);
> Also, memset the raw_node_ref to 0xdeadbeef before you free it. (Or run
> with slab poisoning enabled in Linux). We should go through the code and
> make sure manually that nothing's going to dereference a pointer to the
> old node after it's freed, but the poisoning is a quick and useful
> debugging aid.
eCos, which I'm using, has this facility built in:
CYGDBG_MEMALLOC_ALLOCATOR_DLMALLOC_DEBUG
--
Øyvind Harboe
http://www.zylin.com
next prev parent reply other threads:[~2004-07-21 6:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1089643331.3951.42.camel@famine>
[not found] ` <1089711000.2899.96.camel@hades.cambridge.redhat.com>
[not found] ` <1089712151.5995.21.camel@famine>
[not found] ` <1089713133.2899.117.camel@hades.cambridge.redhat.com>
[not found] ` <1089726079.6288.5.camel@famine>
2004-07-13 23:01 ` JFFS2 eats memory David Woodhouse
2004-07-14 8:15 ` Øyvind Harboe
2004-07-19 14:18 ` Øyvind Harboe
2004-07-19 14:24 ` David Woodhouse
2004-07-19 15:15 ` Øyvind Harboe
2004-07-20 1:10 ` David Woodhouse
2004-07-20 6:41 ` Øyvind Harboe
2004-07-20 13:45 ` David Woodhouse
2004-07-20 15:28 ` Øyvind Harboe
2004-07-20 15:54 ` David Woodhouse
2004-07-20 18:52 ` Øyvind Harboe
2004-07-20 22:08 ` David Woodhouse
2004-07-21 6:25 ` Øyvind Harboe [this message]
2004-07-21 11:51 ` David Woodhouse
2004-07-21 12:03 ` Øyvind Harboe
2004-07-21 13:25 ` David Woodhouse
2004-07-20 13:37 ` Øyvind Harboe
2008-04-08 15:16 Jürgen Lambrecht
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=1090391133.15766.4.camel@famine \
--to=oyvind.harboe@zylin.com \
--cc=dwmw2@infradead.org \
--cc=ecos-discuss@sources.redhat.com \
--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