linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: Richard Weinberger <richard@nod.at>,
	adrian.hunter@intel.com, Heinz.Egger@linutronix.de,
	shmulik.ladkani@gmail.com, tglx@linutronix.de,
	tim.bird@am.sony.com
Subject: [PATCH 04/21] UBI: Fastmap: Check for duplicated PEBs in add_aeb()
Date: Wed, 13 Jun 2012 12:42:01 +0200	[thread overview]
Message-ID: <1339584138-69914-5-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1339584138-69914-1-git-send-email-richard@nod.at>

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/fastmap.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index d446fc3..97d694f 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -53,6 +53,10 @@ static int add_aeb(struct ubi_attach_info *ai, struct list_head *list,
 {
 	struct ubi_ainf_peb *aeb;
 
+	list_for_each_entry(aeb, list, u.list)
+		if (aeb->pnum == pnum)
+			return 0;
+
 	aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
 	if (!aeb)
 		return -ENOMEM;
-- 
1.7.6.5

  parent reply	other threads:[~2012-06-13 10:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 10:41 UBI Fastmap updates (v7++) Richard Weinberger
2012-06-13 10:41 ` [PATCH 01/21] UBI: Fastmap: enhance find_early_wl_entry() Richard Weinberger
2012-06-13 10:41 ` [PATCH 02/21] UBI: Fastmap: Add PEB leak detection Richard Weinberger
2012-06-13 10:42 ` [PATCH 03/21] UBI: Fastmap: Remove useless code Richard Weinberger
2012-06-13 10:42 ` Richard Weinberger [this message]
2012-06-13 10:42 ` [PATCH 05/21] UBI: Fastmap: Rewrite scan_pool() Richard Weinberger
2012-06-13 10:42 ` [PATCH 06/21] UBI: Fastmap: Ensure that new_fm->e[0]->ec is always set Richard Weinberger
2012-06-13 10:42 ` [PATCH 07/21] UBI: Fastmap: Prevent PEB leak Richard Weinberger
2012-06-13 10:42 ` [PATCH 08/21] UBI: Fastmap: Add scrub support to add_aeb() Richard Weinberger
2012-06-13 10:42 ` [PATCH 09/21] UBI: Fastmap: Make ubi_wl_get_fm_peb() return a ubi_wl_entry Richard Weinberger
2012-06-13 10:42 ` [PATCH 10/21] UBI: Fastmap: Detect whether a PEB has to be unmapped Richard Weinberger
2012-06-13 10:42 ` [PATCH 11/21] UBI: Fastmap: Adjust comment above ubi_wl_flush() Richard Weinberger
2012-06-13 10:42 ` [PATCH 12/21] UBI: Fastmap: Handle unused "used" PEBs better Richard Weinberger
2012-06-13 10:42 ` [PATCH 13/21] UBI: Fastmap: Introduce WL pool Signed-off-by: Richard Weinberger <richard@nod.at> Richard Weinberger
2012-06-27  4:13   ` Artem Bityutskiy
2012-06-27  8:20     ` Richard Weinberger
2012-06-27  8:30       ` Artem Bityutskiy
2012-06-13 10:42 ` [PATCH 14/21] UBI: Fastmap: Erase PEBs synchronous in wear_leveling_worker() Richard Weinberger
2012-06-13 10:42 ` [PATCH 15/21] UBI: Fastmap: Fix NULL-pointer bug Richard Weinberger
2012-06-13 10:42 ` [PATCH 16/21] UBI: Fastmap: Fix loglevel Richard Weinberger
2012-06-13 10:42 ` [PATCH 17/21] UBI: Fastmap: Relax EC self check Richard Weinberger
2012-06-13 10:42 ` [PATCH 18/21] UBI: Fastmap: Store magic values in be32 Richard Weinberger
2012-06-13 10:42 ` [PATCH 19/21] UBI: Fastmap: Minor fixes Richard Weinberger
2012-06-13 10:42 ` [PATCH 20/21] UBI: Fastmap: Torture fastmap PEBs that showed bit flips Richard Weinberger
2012-06-13 10:42 ` [PATCH 21/21] UBI: Fastmap: make checkpatch.pl happy Signed-off-by: Richard Weinberger <richard@nod.at> Richard Weinberger

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=1339584138-69914-5-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --cc=Heinz.Egger@linutronix.de \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=shmulik.ladkani@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tim.bird@am.sony.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).