[PATCH 3/4] UBI: Fastmap: Care about the protection queue
Richard Weinberger
richard at nod.at
Mon Oct 20 09:17:13 PDT 2014
Am 20.10.2014 um 18:09 schrieb Artem Bityutskiy:
> On Mon, 2014-10-20 at 17:59 +0200, Richard Weinberger wrote:
>>> Also, say, PEB X is in the work queue waiting for erasure. Fastmap comes
>>> along and saves it as "must be erased" in the fastmap. Fastmap finishes
>>> its job, PEB X gets erased, and I write my data there, so PEB X is
>>> referred to by LEB Y. Now I have power cut. Then I attach the flash
>>> again. Surely it is not that fastmap just erases PEB X and I lose the
>>> contents of LEB Y?
>>
>> This cannot happen. If X is erased you cannot write data do it. I must first go
>> thought the pool and the pool is scanned while attaching.
>
> Just noticed from the code that we first add PEBs to the erase list, and
> then we go an scan the pools.
In the attach code, yes. But this does not matter.
It cannot happen that a fastmap is written with a PEB being in a pool
and the erase job list.
If you figure out such a state, please tell me. I'll fix it. :-)
Thanks,
//richard
More information about the linux-mtd
mailing list