Re: [PATCH 3/4] UBI: Fastmap: Care about the protection queue

From: Richard Weinberger
Date: Mon Oct 20 2014 - 12:17:22 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/