linux/drivers/mtd/ubi
Richard Weinberger 36a87e44f6 UBI: Fastmap: Fix race in ubi_eba_atomic_leb_change()
This function a) requests a new PEB, b) writes data to it,
c) returns the old PEB and d) registers the new PEB in the EBA table.

For the non-fastmap case this works perfectly fine and is powercut safe.
Is fastmap enabled this can lead to issues.
If a new fastmap is written between a) and c) the freshly requested PEB
is no longer in a pool and will not be scanned upon attaching.
If now a powercut happens between c) and d) the freshly requested PEB
will not be scanned and the old one got already scheduled for erase.
After attaching the EBA table will point to a erased PEB.

Fix this issue by swapping steps c) and d).

Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26 22:45:58 +01:00
..
attach.c UBI: Remove alloc_ai() slab name from parameter list 2015-03-26 22:45:57 +01:00
block.c UBI: block: Fix checking for NULL instead of IS_ERR() 2015-02-12 23:33:32 +01:00
build.c UBI: Fastmap: Fix fastmap usage in ubi_volume_notify() 2015-03-26 22:45:56 +01:00
cdev.c UBI: fix check for "too many bytes" 2015-03-26 12:07:18 +01:00
debug.c UBI: Extend UBI layer debug/messaging capabilities 2014-11-07 12:08:51 +02:00
debug.h mtd: rename random32() to prandom_u32() 2013-02-04 09:26:28 +02:00
eba.c UBI: Fastmap: Fix race in ubi_eba_atomic_leb_change() 2015-03-26 22:45:58 +01:00
fastmap.c UBI: Fastmap: Fix memory leak while attaching 2015-03-26 22:45:57 +01:00
gluebi.c UBI: gluebi: rename misleading variables 2012-11-30 13:54:41 +02:00
io.c UBI: extend UBI layer debug/messaging capabilities - cosmetics 2015-01-28 16:09:09 +01:00
kapi.c UBI: Add initial support for scatter gather 2015-01-28 16:04:26 +01: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-01-28 16:18:09 +01:00
ubi-media.h UBI: Add fastmap on-flash data structures 2012-10-03 12:29:37 +03:00
ubi.h UBI: Fastmap: Wrap fastmap specific function in a ifdef 2015-03-26 22:45:56 +01:00
upd.c UBI: Fix invalid vfree() 2014-11-07 15:14:09 +02:00
vmt.c UBI: Extend UBI layer debug/messaging capabilities 2014-11-07 12:08:51 +02:00
vtbl.c UBI: extend UBI layer debug/messaging capabilities - cosmetics 2015-01-28 16:09:09 +01:00
wl.c UBI: Fastmap: Notify user in case of an ubi_update_fastmap() failure 2015-03-26 22:45:55 +01:00