UBIFS recovery fail after power-cut
Artem Bityutskiy
dedekind1 at gmail.com
Fri Apr 13 12:59:10 EDT 2012
On Wed, 2012-04-04 at 20:09 +0800, b w wrote:
> Hello list,
> Using kernel 2.6.32 (which have already apply the latest UBIFS
> and UBI patches),nor flash.
> UBIFS mount fail fail after an power cut due to recovery . Recovery
> failed because after power cut ,the flash image is like this:
> 02ab3eb0h: 00 00 00 00 00 00 00 00 00 E6 0C 00 11 00 00 00
> 02ab3ec0h: 31 18 10 06 04 80 DE AF FF FF FF FF FF FF FF FF
> 02ab3ed0h: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
> 02ab3ee0h: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
> 02ab3ef0h: 05 89 AB CD EF 89 AB CD EF 20 00 00 00 00 00 00
> 02ab3f00h: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
> First,when ubifs_recover_leb call ubifs_scan_a_node,and found that in
> 0x02ab3ec8h
> had a bad node type,so ubifs_scan_a_node return SCANNED_A_CORRUPT_NODE.
OK.
> Then in ubifs_recover_leb,when call no_more_nodes this function return
> 0 (which i think
> should be return 1).At last recovery failed,so mount failed too.
We have this code in that function:
/* Check for empty space after the corrupt node's common header */
skip = ALIGN(offs + UBIFS_CH_SZ, c->max_write_size) - offs;
if (is_empty(buf + skip, len - skip))
return 1;
UBIFS_CH_SZ is 64, c->max_write_size is 64, then ALIGN(offs +
UBIFS_CH_SZ, c->max_write_size) should be 0x2ab3f40, which points to the
area with all 0xFFs, so 'is_empty' should return 1.
Did you check that your c->max_write_size is 64?
Preserve the image for investigations.
--
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120413/db11daaa/attachment.sig>
More information about the linux-mtd
mailing list