aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/eba.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/eba.c')
-rw-r--r--drivers/mtd/ubi/eba.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index fe74749e0dae..4be671815014 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -418,7 +418,7 @@ retry:
418 * may try to recover data. FIXME: but this is 418 * may try to recover data. FIXME: but this is
419 * not implemented. 419 * not implemented.
420 */ 420 */
421 if (err == UBI_IO_BAD_HDR_READ || 421 if (err == UBI_IO_BAD_HDR_EBADMSG ||
422 err == UBI_IO_BAD_HDR) { 422 err == UBI_IO_BAD_HDR) {
423 ubi_warn("corrupted VID header at PEB " 423 ubi_warn("corrupted VID header at PEB "
424 "%d, LEB %d:%d", pnum, vol_id, 424 "%d, LEB %d:%d", pnum, vol_id,
@@ -963,7 +963,7 @@ write_error:
963static int is_error_sane(int err) 963static int is_error_sane(int err)
964{ 964{
965 if (err == -EIO || err == -ENOMEM || err == UBI_IO_BAD_HDR || 965 if (err == -EIO || err == -ENOMEM || err == UBI_IO_BAD_HDR ||
966 err == UBI_IO_BAD_HDR_READ || err == -ETIMEDOUT) 966 err == UBI_IO_BAD_HDR_EBADMSG || err == -ETIMEDOUT)
967 return 0; 967 return 0;
968 return 1; 968 return 1;
969} 969}
@@ -1201,6 +1201,9 @@ static void print_rsvd_warning(struct ubi_device *ubi,
1201 1201
1202 ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d," 1202 ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d,"
1203 " need %d", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); 1203 " need %d", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level);
1204 if (ubi->corr_peb_count)
1205 ubi_warn("%d PEBs are corrupted and not used",
1206 ubi->corr_peb_count);
1204} 1207}
1205 1208
1206/** 1209/**
@@ -1263,6 +1266,9 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
1263 if (ubi->avail_pebs < EBA_RESERVED_PEBS) { 1266 if (ubi->avail_pebs < EBA_RESERVED_PEBS) {
1264 ubi_err("no enough physical eraseblocks (%d, need %d)", 1267 ubi_err("no enough physical eraseblocks (%d, need %d)",
1265 ubi->avail_pebs, EBA_RESERVED_PEBS); 1268 ubi->avail_pebs, EBA_RESERVED_PEBS);
1269 if (ubi->corr_peb_count)
1270 ubi_err("%d PEBs are corrupted and not used",
1271 ubi->corr_peb_count);
1266 err = -ENOSPC; 1272 err = -ENOSPC;
1267 goto out_free; 1273 goto out_free;
1268 } 1274 }