[PATCH 0/4] UBI: improve empty flash handling
Artem Bityutskiy
Artem.Bityutskiy at nokia.com
Mon May 3 06:12:58 EDT 2010
Hi Sebastian,
I've removed your 'UBI: recognize empty flash with errors as empty'
patch from the ubi-2.6.git tree, because it solves one problem, but
introduces another, and needs more work, as you yourself pointed.
This is a series of patches which is intended to fix your problem.
Basically, the idea is that during scanning, we just remember the
information about which eraseblocks we found. Then at the end, we
look at them and decide what to do.
We do the following:
1. If there are more than 8 corrupted eraseblocks, we print a warning.
This functionality was there before. This is just a warning, nothing
else.
2. If more than 5% or eraseblocks are corrupted, we refuse. This logic
was not there, I've just added it.
3. If now UBI-formatted eraseblocks were found, then we start checking
whether this is empty device and we should format it. Otherwise, we
go forward and try to attach the device.
3.1 If there are not corrupted eraseblocks -> empty, format
3.2 If there are few corrupted eraseblocks, all of them had read error
-> empty, format. This is the place where we handle the "empty
flash with few bad eraseblocks not marked yet as such"
3.3 If there is a corrupted eraseblock, and there was not read error,
or if there are many corrupted eraseblocks (>= 8), then we refuse.
Please, review and test the following series.
P.S. I gave it only a very quick try
Artem.
More information about the linux-mtd
mailing list