linux/drivers/mtd/ubi
Richard Weinberger 972228d874 ubi: Make recover_peb power cut aware
recover_peb() was never power cut aware,
if a power cut happened right after writing the VID header
upon next attach UBI would blindly use the new partial written
PEB and all data from the old PEB is lost.

In order to make recover_peb() power cut aware, write the new
VID with a proper crc and copy_flag set such that the UBI attach
process will detect whether the new PEB is completely written
or not.
We cannot directly use ubi_eba_atomic_leb_change() since we'd
have to unlock the LEB which is facing a write error.

Cc: stable@vger.kernel.org
Reported-by: Jörg Pfähler <pfaehler@isse.de>
Reviewed-by: Jörg Pfähler <pfaehler@isse.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
2016-06-23 00:29:32 +02:00
..
Kconfig
Makefile
attach.c UBI: drop null test before destroy functions 2015-10-03 20:36:10 +02:00
block.c
build.c ubi: Don't bypass ->getattr() 2016-06-14 10:51:42 +02:00
cdev.c wrappers for ->i_mutex access 2016-01-22 18:04:28 -05:00
debug.c UBI: Silence an unintialized variable warning 2016-05-24 15:24:30 +02:00
debug.h
eba.c ubi: Make recover_peb power cut aware 2016-06-23 00:29:32 +02:00
fastmap-wl.c ubi: fastmap: Implement produce_free_peb() 2015-10-03 23:25:30 +02:00
fastmap.c UBI: Fix static volume checks when Fastmap is used 2016-05-24 15:24:37 +02:00
gluebi.c UBI: Update comments to reflect UBI_METAONLY flag 2015-10-03 20:11:59 +02:00
io.c UBI: fix use of "VID" vs. "EC" in header self-check 2015-12-16 22:46:26 +01:00
kapi.c ubi: Don't bypass ->getattr() 2016-06-14 10:51:42 +02:00
misc.c mtd: ubi: Add logging functions ubi_msg, ubi_warn and ubi_err 2016-03-20 21:36:05 +01:00
ubi-media.h UBI: Fix typo in comment 2015-10-03 20:09:41 +02:00
ubi.h UBI: Fix static volume checks when Fastmap is used 2016-05-24 15:24:37 +02:00
upd.c ubi: Fix out of bounds write in volume update code 2016-03-05 21:56:23 +01:00
vmt.c UBI: Clean up return in ubi_remove_volume() 2016-05-24 15:24:26 +02:00
vtbl.c UBI: return ENOSPC if no enough space available 2015-09-29 12:47:05 +02:00
wl.c UBI: Set free_count to zero before walking through erase list 2016-05-24 15:24:33 +02:00
wl.h