Skip to content

Commit ef5aafb

Browse files
saschahauerrichardweinberger
authored andcommitted
ubi: fastmap: Fix inverted logic in seen selfcheck
set_seen() sets the bit corresponding to the PEB number in the bitmap, so when self_check_seen() wants to find PEBs that haven't been seen we have to print the PEBs that have their bit cleared, not the ones which have it set. Fixes: 5d71afb ("ubi: Use bitmaps in Fastmap self-check code") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent b3a987b commit ef5aafb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/mtd/ubi/fastmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int self_check_seen(struct ubi_device *ubi, unsigned long *seen)
6464
return 0;
6565

6666
for (pnum = 0; pnum < ubi->peb_count; pnum++) {
67-
if (test_bit(pnum, seen) && ubi->lookuptbl[pnum]) {
67+
if (!test_bit(pnum, seen) && ubi->lookuptbl[pnum]) {
6868
ubi_err(ubi, "self-check failed for PEB %d, fastmap didn't see it", pnum);
6969
ret = -EINVAL;
7070
}

0 commit comments

Comments
 (0)