Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

UBI: erase free PEB with bitflip in EC header

Without this patch, these PEB are not scrubbed until we put data in them.
Bitflip can accumulate latter and we can loose the EC header (but VID header
should be intact and allow to recover data).

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
Cc: stable@vger.kernel.org
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

authored by

Matthieu CASTET and committed by
Artem Bityutskiy
193819cf abb3e011

+1 -1
+1 -1
drivers/mtd/ubi/attach.c
··· 975 975 return err; 976 976 goto adjust_mean_ec; 977 977 case UBI_IO_FF: 978 - if (ec_err) 978 + if (ec_err || bitflips) 979 979 err = add_to_list(ai, pnum, UBI_UNKNOWN, 980 980 UBI_UNKNOWN, ec, 1, &ai->erase); 981 981 else