jffs2: fix hangs/crashs when not using CONFIG_JFFS2_PART_SIZE
PATCH 1/1 jffs2: fix hangs/crashs when not using CONFIG_JFFS2_PART_SIZE
Commit b5b004ad8a0ac6f98bd5708ec8b22fbddd1c1042 caused the sector_size to be calculated incorrectly when the part size was not hardcoded. This is because the new code relied on part->size but tried to do the calculation before it was initialized properly, and it did not take into consideration the magic SIZE_REMAINING define.
--- common/cmd_jffs2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
common/cmd_jffs2.c +2 -2
@@ -406,8 +406,6 @@ int mtdparts_init(void) part->offset =0x00000000 ;#endif - part->sector_size =get_part_sector_size (id, part); - part->dev = current_mtd_dev;INIT_LIST_HEAD (&part->link);
@@ -415,6 +413,8 @@ int mtdparts_init(void)if (part->size ==SIZE_REMAINING ) part->size = id->size - part->offset; + part->sector_size =get_part_sector_size (id, part); +DEBUGF ("part : name = %s, size = 0x%08lx, offset = 0x%08lx\n" , part->name, part->size, part->offset);
Signature · 1 line
1.6.6
Wolfgang Denk
AppliedPATCH 1/1 jffs2: fix hangs/crashs when not using CONFIG_JFFS2_PART_SIZE
Dear Mike Frysinger,
Quoted 10 lines · In message <[email protected]> you wrote:
Commit
b5b004ad8a0ac6f98bd5708ec8b22fbddd1c1042caused thesector_sizeto be calculated incorrectly when the part size was not hardcoded. This is because the new code relied onpart->sizebut tried to do the calculation before it was initialized properly, and it did not take into consideration the magicSIZE_REMAININGdefine.Signed-off-by Mike Frysinger <[email protected]>--- common/cmd_jffs2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Things that try to look like things often do look more like things than things. Well-known fact. - Terry Pratchett, _Wyrd Sisters_