diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-09-03 10:11:37 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-10-19 10:19:57 -0400 |
commit | 0525dac9fd31e5a12fb934238abd09e2752a5967 (patch) | |
tree | 9f5f04c0d073d9c4e628afdaa5ad00a1504061f0 /drivers/mtd/ubi/vtbl.c | |
parent | 3fb34124da9d5e37576d9f87d7a5005ba1d82dd7 (diff) |
UBI: do not put eraseblocks to the corrupted list unnecessarily
Currently UBI maintains 2 lists of PEBs during scanning:
1. 'erase' list - PEBs which have no corruptions but should be erased
2. 'corr' list - PEBs which have some corruptions and should be erased
But we do not really need 2 lists for PEBs which should be erased after
scanning is done - this is redundant. So this patch makes sure all PEBs
which are corrupted are moved to the head of the 'erase' list. We add
them to the head to make sure they are erased first and we get rid of
corruption ASAP.
However, we do not remove the 'corr' list and realted functions, because
the plan is to use this list for other purposes. Namely, we plan to
put eraseblocks with corruption which does not look like it was caused
by unclean power cut. Then we'll preserve thes PEBs in order to avoid
killing potentially valuable user data.
This patch also amends PEBs accounting, because it was closely tight to
the 'erase'/'corr' lists separation.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/vtbl.c')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 14c10bed94ee..3bfe00a94667 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -366,7 +366,7 @@ write_error: | |||
366 | * Probably this physical eraseblock went bad, try to pick | 366 | * Probably this physical eraseblock went bad, try to pick |
367 | * another one. | 367 | * another one. |
368 | */ | 368 | */ |
369 | list_add_tail(&new_seb->u.list, &si->corr); | 369 | list_add(&new_seb->u.list, &si->erase); |
370 | goto retry; | 370 | goto retry; |
371 | } | 371 | } |
372 | kfree(new_seb); | 372 | kfree(new_seb); |