On 11/24/2014 10:20 AM, Richard Weinberger wrote:
> Fastmap can miss a PEB if it is in the protection queue
> and not jet in the used tree.

s/jet/yet

> Treat every protected PEB as used.
> 

I'm wondering if we can have a detailed description of the issues this
commit fixes (if any?). In other words, what's the result of *not*
having the patch?

> Signed-off-by: Richard Weinberger <[email protected]>
> ---
>  drivers/mtd/ubi/fastmap.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
> index b56672b..db3defd 100644
> --- a/drivers/mtd/ubi/fastmap.c
> +++ b/drivers/mtd/ubi/fastmap.c
> @@ -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)) {
> 


-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to