Skip to content

Commit ecbfa8e

Browse files
Boris Brezillonrichardweinberger
authored andcommitted
UBI: fastmap: scrub PEB when bitflips are detected in a free PEB EC header
scan_pool() does not mark the PEB for scrubing when bitflips are detected in the EC header of a free PEB (VID header region left to 0xff). Make sure we scrub the PEB in this case. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Fixes: dbb7d2a ("UBI: Add fastmap core") Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 4c36842 commit ecbfa8e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mtd/ubi/fastmap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,11 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai,
498498
unsigned long long ec = be64_to_cpu(ech->ec);
499499
unmap_peb(ai, pnum);
500500
dbg_bld("Adding PEB to free: %i", pnum);
501+
501502
if (err == UBI_IO_FF_BITFLIPS)
502-
add_aeb(ai, free, pnum, ec, 1);
503-
else
504-
add_aeb(ai, free, pnum, ec, 0);
503+
scrub = 1;
504+
505+
add_aeb(ai, free, pnum, ec, scrub);
505506
continue;
506507
} else if (err == 0 || err == UBI_IO_BITFLIPS) {
507508
dbg_bld("Found non empty PEB:%i in pool", pnum);

0 commit comments

Comments
 (0)