From: Artem Bityutskiy Date: Sun, 19 Jul 2009 11:03:16 +0000 (+0300) Subject: UBI: print a message if ECH is corrupted and VIDH is ok X-Git-Tag: v2.6.32-rc1~620^2~5 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=29a88c99d29834fb3314e0144900b187ede83106;p=net-next-2.6.git UBI: print a message if ECH is corrupted and VIDH is ok 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 --- diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index b847745394b..93361eadab8 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c @@ -864,7 +864,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;