linux/drivers/mtd/ubi
Richard Weinberger bd0e924c93 ubi: Make volume resize power cut aware
[ Upstream commit 4946784bd3 ]

When the volume resize operation shrinks a volume,
LEBs will be unmapped. Since unmapping will not erase these
LEBs immediately we have to wait for that operation to finish.
Otherwise in case of a power cut right after writing the new
volume table the UBI attach process can find more LEBs than the
volume table knows. This will render the UBI image unattachable.

Fix this issue by waiting for erase to complete and write the new
volume table afterward.

Cc: <stable@vger.kernel.org>
Reported-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
History 2016-08-22 12:23:24 -04:00
..
attach.c UBI: account for bitflips in both the VID header and data 2015-05-17 19:12:10 -04:00
block.c UBI: block: Add support for the UBI_VOLUME_UPDATED notification 2014-09-16 19:02:04 +03:00
build.c ubi: Fix race condition between ubi device creation and udev 2016-08-22 12:23:23 -04:00
cdev.c UBI: fix check for "too many bytes" 2015-05-17 19:12:11 -04: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: Fastmap: Fix race in ubi_eba_atomic_leb_change() 2016-07-12 08:46:59 -04:00
fastmap.c UBI: Fix static volume checks when Fastmap is used 2016-06-06 19:11:13 -04:00
gluebi.c UBI: gluebi: rename misleading variables 2012-11-30 13:54:41 +02:00
io.c UBI: Validate data_size 2015-10-27 22:14:15 -04: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: comply with coding style 2012-09-04 09:39:01 +03:00
ubi-media.h UBI: Add fastmap on-flash data structures 2012-10-03 12:29:37 +03:00
ubi.h UBI: Fix static volume checks when Fastmap is used 2016-06-06 19:11:13 -04:00
upd.c ubi: Fix out of bounds write in volume update code 2016-03-13 13:53:41 -04:00
vmt.c ubi: Make volume resize power cut aware 2016-08-22 12:23:24 -04:00
vtbl.c UBI: return ENOSPC if no enough space available 2015-10-27 22:14:16 -04:00
wl.c UBI: Fastmap: Ensure that only one fastmap work is scheduled 2016-06-06 19:11:12 -04:00