Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213023
b: refs/heads/master
c: e0e718c
h: refs/heads/master
i:
  213021: fadf254
  213019: c50911b
  213015: 354fedc
  213007: 7c21922
  212991: 0c478d4
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Oct 19, 2010
1 parent 3c2b07b commit 4dc5572
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 92e1a7d9e7e07fb1cf0cbbcdf202938d0819b54d
refs/heads/master: e0e718c281ce1dd4006681e1255535cc6f2857d4
14 changes: 7 additions & 7 deletions trunk/drivers/mtd/ubi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
int pnum)
{
long long uninitialized_var(ec);
int err, bitflips = 0, vol_id, ec_corr = 0;
int err, bitflips = 0, vol_id, ec_err = 0;

dbg_bld("scan PEB %d", pnum);

Expand Down Expand Up @@ -756,12 +756,12 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
* corrupted. Set %bitflips flag in order to make this PEB be
* moved and EC be re-created.
*/
ec_corr = err;
ec_err = err;
ec = UBI_SCAN_UNKNOWN_EC;
bitflips = 1;
}

if (!ec_corr) {
if (!ec_err) {
int image_seq;

/* Make sure UBI version is OK */
Expand Down Expand Up @@ -817,10 +817,10 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
else if (err == UBI_IO_BITFLIPS)
bitflips = 1;
else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR ||
(err == UBI_IO_FF && ec_corr) || err == UBI_IO_FF_BITFLIPS) {
(err == UBI_IO_FF && ec_err) || err == UBI_IO_FF_BITFLIPS) {
/* VID header is corrupted */
if (err == UBI_IO_BAD_HDR_EBADMSG ||
ec_corr == UBI_IO_BAD_HDR_EBADMSG)
ec_err == UBI_IO_BAD_HDR_EBADMSG)
si->read_err_count += 1;
err = add_to_list(si, pnum, ec, &si->corr);
if (err)
Expand Down Expand Up @@ -870,15 +870,15 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
}
}

if (ec_corr)
if (ec_err)
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;

adjust_mean_ec:
if (!ec_corr) {
if (!ec_err) {
si->ec_sum += ec;
si->ec_count += 1;
if (ec > si->max_ec)
Expand Down

0 comments on commit 4dc5572

Please sign in to comment.