From 4a406856ea6830d8b8dba6a27d9f9331c5f4c13a Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Sun, 19 Jul 2009 14:33:14 +0300 Subject: UBI: print a warning if too many PEBs are corrupted There was a bug report recently where UBI prints: UBI error: ubi_attach_mtd_dev: failed to attach by scanning, error -22 error messages and refuses to attach a PEB. It turned out to be a buggy flash driver which returned garbage to almost every UBI read. This patch makes UBI print a better message in such cases. Namely, if UBI finds 8 or more corrupted PEBs, it prints a warning and lists the corrupted PEBs. Signed-off-by: Artem Bityutskiy --- drivers/mtd/ubi/scan.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/mtd/ubi/scan.h') diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h index 1017cf12def5..bab31695dace 100644 --- a/drivers/mtd/ubi/scan.h +++ b/drivers/mtd/ubi/scan.h @@ -102,6 +102,7 @@ struct ubi_scan_volume { * @mean_ec: mean erase counter value * @ec_sum: a temporary variable used when calculating @mean_ec * @ec_count: a temporary variable used when calculating @mean_ec + * @corr_count: count of corrupted PEBs * @image_seq_set: indicates @ubi->image_seq is known * * This data structure contains the result of scanning and may be used by other @@ -125,6 +126,7 @@ struct ubi_scan_info { int mean_ec; uint64_t ec_sum; int ec_count; + int corr_count; int image_seq_set; }; -- cgit v1.2.2