UBIFS mount failure upon power off

Artem Bityutskiy dedekind1 at gmail.com
Sun Apr 22 10:24:36 EDT 2012


On Sun, 2012-04-22 at 21:52 +0800, Mark wrote:
> On 04/22/2012 09:15 PM, Artem Bityutskiy wrote:
> > Hi,
> >
> > On Wed, 2012-04-11 at 20:17 +0800, Mark wrote:
> >>  brcmnand_read_page: 3: brcmnand_posted_read_cache failed at
> >>  offset=3c81c00, ret=-77
> >>  UBI error: ubi_io_read: error -77 while reading 126976 bytes from PEB
> >>  21:4096, read 2048 bytes
> >>  UBIFS error (pid 484): ubifs_start_scan: cannot read 126976 bytes from
> >>  LEB 18:0, error -5
> >>  mount: mounting ubi13_0 on /usr/local/appdata failed: Input/output
> >>  error
> >>
> > Please fix your NAND driver and why it returns strange error code
> > -EBADFD (-77). Uncorrectable ECC errors should be reported as -EBADMSG
> > instead. Bit-flips as -EUCLEAN.
> >
> 
> Thank you very much, I still have some questions:
> 
> 1. I'm using mips platform so I think "-77" is "-EBADMSG":
>        ./arch/mips/include/asm/errno.h:51:#define      EBADMSG 
> 77      /* Not a data message */

Oh, ok, sorry.

> 
> 2. I found these comments in ubi_io_read():
> 	        /* 
>  
> 
>                   * The driver should never return -EBADMSG if it failed 
> to read 
> 
>                   * all the requested data. But some buggy drivers might 
> do 
> 
>                   * this, so we change it to -EIO. 
>  
> 
>                   */
> 
>     but seems my nand driver do_read_ops() function returns immediately
>     on an ecc error. Why the driver must continue reading the left data?

Yes, I ask the driver to read 5 NAND pages, then it should read all 5,
even if the second one has unrecoverable ECC error. But if any page had
ECC errors, it should return -EBADMSG.

> 
> 3. I fixed this problem, in most situations the ubifs can recover 
> successfully,
>     but I still get this error (though difficult to reproduce):
> 
>         UBI error: ubi_io_read: error -77 while reading 126976 bytes 
> from PEB 2:4096, read 126976 bytes
>         UBIFS error (pid 481): insert_node: duplicate sqnum in replay
>         mount: mounting ubi13_0 on /usr/local/hmt/appdata failed: 
> Invalid argument
> 
>     What could be the reason?

Difficult to say, enable UBI debugging - it will print more information
(not all the debugging messages, just debugging).

-- 
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/20120422/65a73852/attachment.sig>


More information about the linux-mtd mailing list