OpenCloudOS-Kernel/drivers/mtd/ubi
Artem Bityutskiy d3f6e6c666 UBI: do not oops when erroneous PEB is scheduled for scrubbing
When an erroneous PEB is scheduling for scrubbing, we end up with the
following oops:

[<c0162404>] (prot_queue_del+0x0/0x50) from [<c01635b4>] (ubi_wl_scrub_peb+0xec/0x13c)
[<c01634c8>] (ubi_wl_scrub_peb+0x0/0x13c) from [<c01603bc>] (ubi_eba_read_leb+0x200/0x428)
[<c01601bc>] (ubi_eba_read_leb+0x0/0x428) from [<c015e3c0>] (ubi_leb_read+0xe8/0x138)
[<c015e2d8>] (ubi_leb_read+0x0/0x138) from [<c00d6918>] (ubifs_start_scan+0x7c/0xf4)
[<c00d689c>] (ubifs_start_scan+0x0/0xf4) from [<c00e3650>] (ubifs_recover_leb+0x3c/0x730)
[<c00e3614>] (ubifs_recover_leb+0x0/0x730) from [<c00e444c>] (ubifs_recover_log_leb+0xc8/0x2dc)
[<c00e4384>] (ubifs_recover_log_leb+0x0/0x2dc) from [<c00d7c20>] (ubifs_replay_journal+0xb90/0x13a4)
[<c00d7090>] (ubifs_replay_journal+0x0/0x13a4) from [<c00cdd68>] (ubifs_fill_super+0xb84/0x1054)
[<c00cd1e4>] (ubifs_fill_super+0x0/0x1054) from [<c00ced04>] (ubifs_get_sb+0xc4/0x2ac)
[<c00cec40>] (ubifs_get_sb+0x0/0x2ac) from [<c007f04c>] (vfs_kern_mount+0x58/0x94)
[<c007eff4>] (vfs_kern_mount+0x0/0x94) from [<c007f0e8>] (do_kern_mount+0x40/0xe8)
[<c007f0a8>] (do_kern_mount+0x0/0xe8) from [<c0095628>] (do_new_mount+0x68/0x8c)
[<c00955c0>] (do_new_mount+0x0/0x8c) from [<c00957a8>] (do_mount+0x15c/0x1b8)
[<c009564c>] (do_mount+0x0/0x1b8) from [<c0095890>] (sys_mount+0x8c/0xd4)
[<c0095804>] (sys_mount+0x0/0xd4) from [<c0023c00>] (ret_fast_syscall+0x0/0x2c)
Kernel panic - not syncing: Fatal exception

The problem is that 'ubi_wl_scrub_peb()' does not expect that PEBs may
be in the erroneous tree, which is a bug. This patch fixes the bug
and adds corresponding check to 'ubi_wl_scrub_peb()'. Now it will simply
ignore erroneous PEBs, instead of causing an oops.

Reported-by: Matthieu CASTET <matthieu.castet@parrot.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-08-30 13:32:31 +03:00
..
Kconfig UBI: fix s/then/than/ typos 2010-05-07 08:33:10 +03:00
Kconfig.debug UBI: fix kconfig unmet dependency 2010-08-30 13:31:34 +03:00
Makefile UBI: make gluebi a separate module 2009-06-03 17:45:23 +03:00
build.c UBI: do not warn unnecessarily 2010-08-02 07:21:19 +03:00
cdev.c UBI: eliminate update of list_for_each_entry loop cursor 2010-08-30 10:19:11 +03:00
debug.c UBI: introduce flash dump helper 2009-08-14 20:02:20 +03:00
debug.h UBI: add write checking 2010-02-01 15:16:37 +02:00
eba.c UBI: do not warn unnecessarily 2010-08-02 07:21:19 +03:00
gluebi.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
io.c UBI: fix error message and compilation warnings 2010-06-14 08:47:49 +03:00
kapi.c UBI: fix s/then/than/ typos 2010-05-07 08:33:10 +03:00
misc.c UBI: avoid unnecessary division operations 2008-07-24 13:32:54 +03:00
scan.c UBI: fix forward compatibility 2010-08-30 10:19:11 +03:00
scan.h UBI: introduce eraseblock counter variables 2010-06-04 11:30:43 +03:00
ubi-media.h UBI: add image sequence number to EC header 2009-07-05 18:47:07 +03:00
ubi.h UBI: introduce a new IO return code 2010-06-04 11:30:42 +03:00
upd.c UBI: fix memory leak in update path 2010-01-18 18:53:56 +02:00
vmt.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vtbl.c UBI: misc comment fixes 2010-05-07 08:33:32 +03:00
wl.c UBI: do not oops when erroneous PEB is scheduled for scrubbing 2010-08-30 13:32:31 +03:00