public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: b w <wdjjwb@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBIFS recovery fail after power-cut
Date: Fri, 13 Apr 2012 19:59:10 +0300	[thread overview]
Message-ID: <1334336350.13160.16.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <CAHvCehVNgTgL+vY8SV1APN_xokogCM=Q+c7U1X9-_H1jn47Dpg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-04-13 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 12:09 UBIFS recovery fail after power-cut b w
2012-04-13 16:59 ` Artem Bityutskiy [this message]
2012-04-17 13:03   ` b w
2012-04-25 15:03     ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334336350.13160.16.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=wdjjwb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox