diff mbox

UBI: print a message if ECH is corrupted and VIDH is ok

Message ID 1248005156-18662-1-git-send-email-dedekind@infradead.org
State Accepted
Commit 29a88c99d29834fb3314e0144900b187ede83106
Headers show

Commit Message

Artem Bityutskiy July 19, 2009, 12:05 p.m. UTC
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

If the EC header is corrupted, but the VID header is OK, UBI accepts the
PEB and treats it as "used". However, generally this should not happen.
Print a warning if this happens.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 drivers/mtd/ubi/scan.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index a423131..44c8273 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -853,7 +853,9 @@  static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
 		}
 	}
 
-	/* Both UBI headers seem to be fine */
+	if (ec_corr)
+		ubi_warn("valid VID header but corrupted EC header at PEB %d",
+			 pnum);
 	err = ubi_scan_add_used(ubi, si, pnum, ec, vidh, bitflips);
 	if (err)
 		return err;