浏览代码

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 <Artem.Bityutskiy@nokia.com>
Artem Bityutskiy 16 年之前
父节点
当前提交
29a88c99d2
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/mtd/ubi/scan.c

+ 3 - 1
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);
 	err = ubi_scan_add_used(ubi, si, pnum, ec, vidh, bitflips);
 	if (err)
 	if (err)
 		return err;
 		return err;