mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
UBI: Fastmap: Care about the protection queue
Fastmap can miss a PEB if it is in the protection queue and not jet in the used tree. Treat every protected PEB as used. Signed-off-by: Richard Weinberger <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]>
This commit is contained in:
parent
fb4325a3d9
commit
4f5e3b6fad
1 changed files with 13 additions and 0 deletions
|
|
@ -1196,6 +1196,19 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
|
|||
fm_pos += sizeof(*fec);
|
||||
ubi_assert(fm_pos <= ubi->fm_size);
|
||||
}
|
||||
|
||||
for (i = 0; i < UBI_PROT_QUEUE_LEN; i++) {
|
||||
list_for_each_entry(wl_e, &ubi->pq[i], u.list) {
|
||||
fec = (struct ubi_fm_ec *)(fm_raw + fm_pos);
|
||||
|
||||
fec->pnum = cpu_to_be32(wl_e->pnum);
|
||||
fec->ec = cpu_to_be32(wl_e->ec);
|
||||
|
||||
used_peb_count++;
|
||||
fm_pos += sizeof(*fec);
|
||||
ubi_assert(fm_pos <= ubi->fm_size);
|
||||
}
|
||||
}
|
||||
fmh->used_peb_count = cpu_to_be32(used_peb_count);
|
||||
|
||||
for (node = rb_first(&ubi->scrub); node; node = rb_next(node)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue