Hi Glen,
Glen Johnson wrote:
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 allowed to be 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 there is never a read made which means 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 expect the first reply to my message here will be for more
information. So here is some basic and will be more than happy to
provide more.
uClinux source: uClinux-dist-20060803
tool chain: m68k-uclinux-tools-20060615.sh
processor: COLDFIRE M5272
Looking forward to being enlightened,
This is a question best asked on the mtd mailing list. All the
JFFS2 and mtd experts hang out there.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude EMAIL: [EMAIL PROTECTED]
SnapGear -- a Secure Computing Company PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev