linux/drivers/mtd/ubi
Richard Weinberger 53fc3ef269 ubi: Be more paranoid while seaching for the most recent Fastmap
commit 74f2c6e9a4 upstream.

Since PEB erasure is asynchornous it can happen that there is
more than one Fastmap on the MTD. This is fine because the attach logic
will pick the Fastmap data structure with the highest sequence number.

On a not so well configured MTD stack spurious ECC errors are common.
Causes can be different, bad hardware, wrong operating modes, etc...
If the most current Fastmap renders bad due to ECC errors UBI might
pick an older Fastmap to attach from.
While this can only happen on an anyway broken setup it will show
completely different sympthoms and makes finding the root cause much
more difficult.
So, be debug friendly and fall back to scanning mode of we're facing
an ECC error while scanning for Fastmap.

Signed-off-by: Richard Weinberger <richard@nod.at>
[bwh: Backported to 3.16:
 - In scan_fast(), use 'ai' instead of 'scan_ai'
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:17:01 +00:00
..
attach.c ubi: Be more paranoid while seaching for the most recent Fastmap 2016-11-20 01:17:01 +00:00
block.c UBI: block: Add missing cache flushes 2015-09-30 13:20:56 +01:00
build.c ubi: Fix race condition between ubi device creation and udev 2016-11-20 01:17:01 +00:00
cdev.c UBI: fix check for "too many bytes" 2015-05-05 11:09:36 +01:00
debug.c UBI: embed ubi_debug_info field in ubi_device struct 2012-12-10 13:38:59 +02:00
debug.h mtd: rename random32() to prandom_u32() 2013-02-04 09:26:28 +02:00
eba.c ubi: Make recover_peb power cut aware 2016-08-22 22:38:18 +01:00
fastmap.c UBI: Fix static volume checks when Fastmap is used 2016-08-22 22:38:04 +01:00
gluebi.c UBI: gluebi: rename misleading variables 2012-11-30 13:54:41 +02:00
io.c UBI: Validate data_size 2015-10-19 15:42:37 +01:00
kapi.c UBI: modify ubi_wl_flush function to clear work queue for a lnum 2012-05-21 11:34:41 +03:00
Kconfig UBI: block: Add CONFIG_BLOCK dependency 2014-03-04 14:49:53 +02:00
Makefile UBI: R/O block driver on top of UBI volumes 2014-02-28 16:29:48 +02:00
misc.c UBI: fix soft lockup in ubi_check_volume() 2015-05-12 09:36:35 +01:00
ubi-media.h UBI: Add fastmap on-flash data structures 2012-10-03 12:29:37 +03:00
ubi.h ubi: Be more paranoid while seaching for the most recent Fastmap 2016-11-20 01:17:01 +00:00
upd.c ubi: Fix out of bounds write in volume update code 2016-03-24 10:01:05 +00:00
vmt.c ubi: Make volume resize power cut aware 2016-11-20 01:17:01 +00:00
vtbl.c UBI: return ENOSPC if no enough space available 2015-10-19 15:47:00 +01:00
wl.c UBI: return ENOSPC if no enough space available 2015-10-19 15:47:00 +01:00