All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Tanya Brokhman <tlinder@codeaurora.org>, dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] UBI: Fastmap: Care about the protection queue
Date: Thu, 02 Oct 2014 15:32:59 +0200	[thread overview]
Message-ID: <542D540B.5010808@nod.at> (raw)
In-Reply-To: <542D5314.3050701@codeaurora.org>

Am 02.10.2014 15:28, schrieb Tanya Brokhman:
> Hi Richard
> 
> On 9/30/2014 1:20 AM, Richard Weinberger wrote:
>> 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 <richard@nod.at>
>> ---
>>   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 2b0d8d6..2853a69 100644
>> --- a/drivers/mtd/ubi/fastmap.c
>> +++ b/drivers/mtd/ubi/fastmap.c
>> @@ -1195,6 +1195,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) {
> 
> why not list_for_each_entry_safe?

Because we don't delete elements from this list while iterating over it.

>> +            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);
> 
> Is fm_size ok with this addition or does it needs updating as well?

It is okay. The fastmap size calculation reserves enough space for all possible
PEBs.

Thanks,
//richard

  reply	other threads:[~2014-10-02 13:33 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 22:20 UBI: Fastmap fixes - round one Richard Weinberger
2014-09-29 22:20 ` [PATCH 1/4] UBI: Ensure that all fastmap work is done upon WL shutdown Richard Weinberger
2014-09-29 22:20   ` Richard Weinberger
2014-09-30  6:26   ` Artem Bityutskiy
2014-09-30  6:58     ` Richard Weinberger
2014-09-30  7:53       ` Bityutskiy, Artem
2014-09-30  7:53         ` Bityutskiy, Artem
2014-09-30  8:07         ` Richard Weinberger
2014-09-30  8:07           ` Richard Weinberger
2014-10-03 12:52           ` Artem Bityutskiy
2014-10-03 12:52             ` Artem Bityutskiy
2014-10-02 13:05   ` Tanya Brokhman
2014-10-02 13:18     ` Richard Weinberger
2014-10-02 13:38       ` Tanya Brokhman
2014-09-29 22:20 ` [PATCH 2/4] UBI: Fastmap: Calc fastmap size correctly Richard Weinberger
2014-09-29 22:20   ` Richard Weinberger
2014-10-02 13:14   ` Tanya Brokhman
2014-10-02 13:18     ` Richard Weinberger
2014-10-02 14:04   ` Tanya Brokhman
2014-10-03 14:38   ` Artem Bityutskiy
2014-09-29 22:20 ` [PATCH 3/4] UBI: Fastmap: Care about the protection queue Richard Weinberger
2014-09-29 22:20   ` Richard Weinberger
2014-10-02 13:28   ` Tanya Brokhman
2014-10-02 13:32     ` Richard Weinberger [this message]
2014-10-02 14:14       ` Tanya Brokhman
2014-10-03 14:31   ` Artem Bityutskiy
2014-10-03 19:06     ` Richard Weinberger
2014-10-13 13:17       ` Artem Bityutskiy
2014-10-13 14:30         ` Richard Weinberger
2014-10-13 15:23           ` Artem Bityutskiy
2014-10-13 15:28             ` Bityutskiy, Artem
2014-10-13 15:28               ` Bityutskiy, Artem
2014-10-13 21:04             ` Richard Weinberger
2014-10-14 10:23               ` Artem Bityutskiy
2014-10-14 12:21                 ` Tanya Brokhman
2014-10-14 13:02                   ` Artem Bityutskiy
2014-10-14 13:35                     ` Tanya Brokhman
2014-10-16 10:06                 ` Richard Weinberger
2014-10-16 10:15                   ` Artem Bityutskiy
2014-10-16 11:07                     ` Richard Weinberger
2014-10-20 14:46                   ` Artem Bityutskiy
2014-10-20 15:17                     ` Richard Weinberger
2014-10-20 15:40                       ` Artem Bityutskiy
2014-10-20 15:59                         ` Richard Weinberger
2014-10-20 16:09                           ` Artem Bityutskiy
2014-10-20 16:17                             ` Richard Weinberger
2014-10-20 20:46                         ` Richard Weinberger
2014-09-29 22:20 ` [PATCH 4/4] UBI: Fastmap: Ensure that only one fastmap work is scheduled Richard Weinberger
2014-09-29 22:20   ` Richard Weinberger
2014-09-30  6:45   ` Bityutskiy, Artem
2014-09-30  6:45     ` Bityutskiy, Artem
2014-09-30  6:59     ` Richard Weinberger
2014-09-30  6:59       ` Richard Weinberger
2014-09-30  7:39       ` Bityutskiy, Artem
2014-09-30  7:39         ` Bityutskiy, Artem
2014-09-30  7:44         ` Richard Weinberger
2014-09-30  7:44           ` Richard Weinberger
2014-10-02 14:22           ` Tanya Brokhman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542D540B.5010808@nod.at \
    --to=richard@nod.at \
    --cc=dedekind1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tlinder@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.