All of lore.kernel.org
 help / color / mirror / Atom feed
* Why the nand chip driver "should never return -EBADMSG if it failed to read all the request data"
@ 2012-04-15 13:49 Mark
  2012-04-22 14:37 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Mark @ 2012-04-15 13:49 UTC (permalink / raw)
  To: zxm927; +Cc: linux-mtd, Artem Bityutskiy

Hi,

During UBIFS power cut tests I get this error message:

...
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
...

I found that's because the nand driver return immediately in an ECC
unrecoverable error. So my question is:
1. Why the nand driver must continue to read all the left data?
2. Why it still can be mount successfully with YAFFS?

And, after I patched the nand driver, in most of the situations the
UBIFS can be successfully recovered, but I still get this error:

...
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
...

Does this mean this should never happen to UBIFS? Then what could be the 
reason?
Thank you very much, and my test environment:

# uname -a
Linux (none) 2.6.31-3.3 #10 SMP Wed Apr 11 09:18:13 CST 2012 mips GNU/Linux

# Run this script, and cut power
# while :; do cp -a /usr/local/platform/f2 /usr/local/appdata/ && sync; done

# ls -l /usr/local/platform/f2
-rw-rw-r--    1 506      506        1048576 Apr 11  2012
/usr/local/platform/f2

# xxd f2
0000000: 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f  ................
0000010: 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f  ................
0000020: 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f  ................
0000030: 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f  ................

# mount
rootfs on / type rootfs (rw)
...
ubi12:platform on /usr/local/platform type ubifs (rw,relatime)
ubi13_0 on /usr/local/appdata type ubifs (rw,sync,relatime)
ubi14_0 on /usr/local/.appmid type ubifs (rw,relatime)

-- 
Have fun,
Mark Zhang

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why the nand chip driver "should never return -EBADMSG if it failed to read all the request data"
  2012-04-15 13:49 Why the nand chip driver "should never return -EBADMSG if it failed to read all the request data" Mark
@ 2012-04-22 14:37 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2012-04-22 14:37 UTC (permalink / raw)
  To: Mark; +Cc: linux-mtd, zxm927

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

On Sun, 2012-04-15 at 21:49 +0800, Mark wrote:
> And, after I patched the nand driver, in most of the situations the
> UBIFS can be successfully recovered, but I still get this error:
> 
> ...
> 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
> ...
> 
> Does this mean this should never happen to UBIFS? Then what could be the 
> reason?
> Thank you very much, and my test environment:

I see ubi_dbg_dump_stack() call in ubi_io_read() when it returns an
error. If you have debugging enabled - you should have the dump in your
kernel buffer.

Yeah, we should turn it into 'dump_stack()' to always have the dump. I'd
gratefully accept a patch.

-- 
Best Regards,
Artem Bityutskiy

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-22 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-15 13:49 Why the nand chip driver "should never return -EBADMSG if it failed to read all the request data" Mark
2012-04-22 14:37 ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.