mtd: fix trx_fixup
authorFelix Fietkau <nbd@openwrt.org>
Wed, 25 Jul 2012 17:28:32 +0000 (17:28 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 25 Jul 2012 17:28:32 +0000 (17:28 +0000)
commit4b99df2303b20e9566b5e11d19631fc789338ead
treecfd322af9842ff436e0e083ba050881b7854ce64
parent2b5ccb33fef209c6c4fbacc1cd98179c0c129ddf
mtd: fix trx_fixup

With the BRCM47xx image I have built (Linksys E3000), there are additional
writes following the completion of "mtd_replace_jffs2" which invalidate the
'trx_fixup' performed by 'mtd_replace_jffs2'.  Moving the 'trx_fixup' to somewhere
after all writes have completed fixes the problem.  I also noticed that 'erasesize'
used to compute 'block_offset' in 'mtd_fixtrx' is used before it is computed by
'mtd_check_open'; moving the call to 'mtd_check_open' up a few lines fixes this.

Unlike 'mtd_fixtrx', 'trx_fixup' appears to assume that the TRX header is always at
offset 0; which may be the cause of the problem described in Ticket #8960.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
SVN-Revision: 32866
package/mtd/Makefile
package/mtd/src/jffs2.c
package/mtd/src/mtd.c
package/mtd/src/trx.c