From: Glen Johnson <gjohnson@valcom.com>
To: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Linux fs/JFFS2 question.
Date: Fri, 16 Feb 2007 07:37:32 -0500 [thread overview]
Message-ID: <45D5A58C.3070304@valcom.com> (raw)
Linux-mtd,
I need some help understanding some code under linux-2.6.x/fs/jffs2.
After trying to mount a JFFS2 file system, by typing mount mtd:JFFS2
/mnt, without success. I did some digging in the code, and I found if I
change a line in linux-2.6.x/fs/jffs2/scan.c mount works! Listed below
is the one change I made in function jffs2_scan_medium().
if (!ret && pointlen < c->mtd->size) { OLD code
if (!ret && pointlen <= c->mtd->size) { NEW code
Later in the function the side effect of this if() statement is an
altered value for buf_size, not 0. This value is then passed to the
function jffs2_scan_eraseblock() where buf_size is tested. Here is
where my understanding of things falls apart.
if (!buf_size) {
/* Do stuff, but do NOT read anything from the flash. */
...
} else {
...
jffs2_fill_scan_buf( ...);
}
It appears to me if buf_size is prevented from being set back in
jffs2_scan_medium() then an actual read from the flash does occur, which
allows mount to read valid data and have success. Otherwise there
appears to me that the read never made, creating a guaranteed failure every time.
Why is this the case?
I can't find where or how the driver ever reads real data otherwise.
Help me see the bigger picture here.
I first sent this to uClinux-devel mailing list so I provided the following info to help describe the context in which I am working.
uClinux source: uClinux-dist-20060803
tool chain: m68k-uclinux-tools-20060615.sh
processor: COLDFIRE M5272
Looking forward to being enlightened,
Glen Johnson
reply other threads:[~2007-02-16 12:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=45D5A58C.3070304@valcom.com \
--to=gjohnson@valcom.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