From: Igor Marnat <marny@rambler.ru>
To: Artem Bityutskiy <dedekind@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: jffs2_gcd_mtd0 invoked oom-killer
Date: Mon, 19 Mar 2007 08:45:52 +0300 [thread overview]
Message-ID: <41978953.20070319084552@rambler.ru> (raw)
In-Reply-To: <1173705053.5493.28.camel@sauron>
Hello Artem and List!
After some investigations I found some details of the problem, hope it
helps.
Having mounted the /dev/mtdblock0 device the jffs2 kernel thread begins garbage
collection. In a function jffs2_get_inode_nodes it tries to assemble
the chain of nodes of inode (if I got it correctly).
I printed the common length of chain of nodes, it is generally 2 or
3, in rare cases it is bigger than 3. My file system on this NAND is corrupted in 2
places (at least). At the first time loop "while (valid_ref)" in jffs2_get_inode_nodes is passed about
28000 times and (I guess) system considers this chain as consisted of
28000 items. This chain passes successfully crc check
of node header in jffs2_get_inode_nodes. Anyway it doesn't pass CRC check later. It writes the
message "JFFS2 notice: (450) check_node_data: wrong data CRC in data
node at" and process continues.
But it cannot pass the second corrupted place. It doesn't meet the
NULL node, so the valid_ref is always not NULL. It passes crc check of node header,
so the loop continues till the system exhausted all the
memory available (there are calls to kmalloc in the loop). When the
chain length grows up to 110000 entries, oom killer begins to stop
kernel threads and a bit later all the system reboots.
The problem is big for me, it is not a problem when some file
gets corrupted but it shouldn't prevent the whole system from running,
especially when the fs in problem is not the root fs.
So the questions are:
1. May be the function jffs2_get_inode_nodes can be improved? It's
possible to pre-calculate chain length before trying to read it into
the memory and allocate memory for it. It can be considered as broken if it's length
exceeds some pre-defined maximum.
2. What can I do with the broken filesystem? Can I repair it?
3. Any other ideas or considerations?
I tried it on a several kernel versions, including 2.6.20.3.
Thank you for your help,
Best regards,
Igor Marnat
mailto:marny@rambler.ru
next prev parent reply other threads:[~2007-03-19 5:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-12 12:28 jffs2_gcd_mtd0 invoked oom-killer Igor Marnat
2007-03-12 13:10 ` Artem Bityutskiy
2007-03-19 5:45 ` Igor Marnat [this message]
2007-03-19 7:19 ` Thomas Gleixner
2007-03-19 11:48 ` Igor Marnat
2007-03-19 16:50 ` Thomas Gleixner
2007-03-20 21:02 ` Igor Marnat
2007-03-21 8:14 ` Igor Marnat
2007-03-21 9:17 ` Thomas Gleixner
2007-03-21 11:40 ` Igor Marnat
2007-03-28 5:15 ` Igor Marnat
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=41978953.20070319084552@rambler.ru \
--to=marny@rambler.ru \
--cc=dedekind@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