UBIFS recovery fail after power-cut
b w
wdjjwb at gmail.com
Tue Apr 17 09:03:57 EDT 2012
> On Wed, 2012-04-04 at 20:09 +0800, b w wrote:
>
>> 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.
>
Thank you very much. I do not apply this patch: "UBIFS: use
max_write_size during recovery". So the code is "skip = ALIGN(offs +
UBIFS_CH_SZ, c->min_io_size) - offs;" the c->min_io_size is 8. When i
modify MTD/UBI/UBIFS and apply that patch,use c->max_write_size
instead,this problem is solved.I think that patch not just an optimize
but fix this problem. Should we use "fix" in the title of that patch?
By the way, in my machine UBIFS_CH_SZ is 24 not 64.
More information about the linux-mtd
mailing list