public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] jffs2_1pass_build_lists max_totlen question
@ 2012-10-22 20:36 arunkann
  0 siblings, 0 replies; only message in thread
From: arunkann @ 2012-10-22 20:36 UTC (permalink / raw)
  To: u-boot


Hi,

I see an issue when the u-boot is unable to load (fsload) the kernel or
device tree files from NOR flash to RAM, occasionally. I am using u-boot
version "U-Boot 2011.12 ".
 
The root cause seems to be the size of ?pL->readbuf? malloc?ed in
jffs2_1pass_build_lists () jffs_1pass.c file.
 
The size used for allocation for 'readbuf' is based on max data size among
the fragmented jNodes ?node->totlen? (excluding summary nodes). It looks
like on the occasions when fsload works, the buffer size is alloc?ed 4164
(empty scan size of 4096 + sizeof jNode 68); this seems to be big enough for
every chunk of data read later on in jffs2_1pass_read_inode(). However, on
occasions when fsload fails; the size alloc?ed for readbuf is fairly small
causing memory corruption in jffs2_1pass_read_inode().
 
I found couple of ways to workaround the issue (statically alloc readbuf for
4164 or provide null ptr for external buffer in get_node_mem() call in
jffs2_1pass_read_inode()).

Why is max_totlen calculation is restricted to size of fragmented nodes and
not summary nodes as well?



-- 
View this message in context: http://old.nabble.com/jffs2_1pass_build_lists-max_totlen-question-tp34588781p34588781.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-22 20:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 20:36 [U-Boot] jffs2_1pass_build_lists max_totlen question arunkann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox