Skip to content

Commit a17bdec

Browse files
saschahauergregkh
authored andcommitted
ubi: fastmap: Fix inverted logic in seen selfcheck
commit ef5aafb upstream. 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 <[email protected]> Signed-off-by: Richard Weinberger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 669210a commit a17bdec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/ubi/fastmap.c

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

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

0 commit comments

Comments
 (0)