Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6

* 'linux-next' of git://git.infradead.org/ubi-2.6:
UBI: do not warn unnecessarily
UBI: do not print message about corruptes PEBs if we have none of them
UBI: improve delete-compatible volumes handling
UBI: fix error message and compilation warnings
UBI: generate random image_seq when formatting MTD devices
UBI: improve ECC error message
UBI: improve corrupted flash handling
UBI: introduce eraseblock counter variables
UBI: introduce a new IO return code
UBI: simplify IO error codes

+198 -74
+2 -1
drivers/mtd/ubi/build.c
··· 593 593 ubi->good_peb_count = ubi->peb_count - ubi->bad_peb_count; 594 594 ubi->max_ec = si->max_ec; 595 595 ubi->mean_ec = si->mean_ec; 596 + ubi_msg("max. sequence number: %llu", si->max_sqnum); 596 597 597 598 err = ubi_read_volume_table(ubi, si); 598 599 if (err) ··· 982 981 ubi_msg("number of PEBs reserved for bad PEB handling: %d", 983 982 ubi->beb_rsvd_pebs); 984 983 ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec); 985 - ubi_msg("image sequence number: %d", ubi->image_seq); 984 + ubi_msg("image sequence number: %d", ubi->image_seq); 986 985 987 986 /* 988 987 * The below lock makes sure we do not race with 'ubi_thread()' which
+43 -6
drivers/mtd/ubi/eba.c
··· 418 418 * may try to recover data. FIXME: but this is 419 419 * not implemented. 420 420 */ 421 - if (err == UBI_IO_BAD_VID_HDR) { 421 + if (err == UBI_IO_BAD_HDR_READ || 422 + err == UBI_IO_BAD_HDR) { 422 423 ubi_warn("corrupted VID header at PEB " 423 424 "%d, LEB %d:%d", pnum, vol_id, 424 425 lnum); ··· 962 961 */ 963 962 static int is_error_sane(int err) 964 963 { 965 - if (err == -EIO || err == -ENOMEM || err == UBI_IO_BAD_VID_HDR || 966 - err == -ETIMEDOUT) 964 + if (err == -EIO || err == -ENOMEM || err == UBI_IO_BAD_HDR || 965 + err == UBI_IO_BAD_HDR_READ || err == -ETIMEDOUT) 967 966 return 0; 968 967 return 1; 969 968 } ··· 1166 1165 } 1167 1166 1168 1167 /** 1168 + * print_rsvd_warning - warn about not having enough reserved PEBs. 1169 + * @ubi: UBI device description object 1170 + * 1171 + * This is a helper function for 'ubi_eba_init_scan()' which is called when UBI 1172 + * cannot reserve enough PEBs for bad block handling. This function makes a 1173 + * decision whether we have to print a warning or not. The algorithm is as 1174 + * follows: 1175 + * o if this is a new UBI image, then just print the warning 1176 + * o if this is an UBI image which has already been used for some time, print 1177 + * a warning only if we can reserve less than 10% of the expected amount of 1178 + * the reserved PEB. 1179 + * 1180 + * The idea is that when UBI is used, PEBs become bad, and the reserved pool 1181 + * of PEBs becomes smaller, which is normal and we do not want to scare users 1182 + * with a warning every time they attach the MTD device. This was an issue 1183 + * reported by real users. 1184 + */ 1185 + static void print_rsvd_warning(struct ubi_device *ubi, 1186 + struct ubi_scan_info *si) 1187 + { 1188 + /* 1189 + * The 1 << 18 (256KiB) number is picked randomly, just a reasonably 1190 + * large number to distinguish between newly flashed and used images. 1191 + */ 1192 + if (si->max_sqnum > (1 << 18)) { 1193 + int min = ubi->beb_rsvd_level / 10; 1194 + 1195 + if (!min) 1196 + min = 1; 1197 + if (ubi->beb_rsvd_pebs > min) 1198 + return; 1199 + } 1200 + 1201 + ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d," 1202 + " need %d", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); 1203 + } 1204 + 1205 + /** 1169 1206 * ubi_eba_init_scan - initialize the EBA sub-system using scanning information. 1170 1207 * @ubi: UBI device description object 1171 1208 * @si: scanning information ··· 1275 1236 if (ubi->avail_pebs < ubi->beb_rsvd_level) { 1276 1237 /* No enough free physical eraseblocks */ 1277 1238 ubi->beb_rsvd_pebs = ubi->avail_pebs; 1278 - ubi_warn("cannot reserve enough PEBs for bad PEB " 1279 - "handling, reserved %d, need %d", 1280 - ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); 1239 + print_rsvd_warning(ubi, si); 1281 1240 } else 1282 1241 ubi->beb_rsvd_pebs = ubi->beb_rsvd_level; 1283 1242
+33 -27
drivers/mtd/ubi/io.c
··· 150 150 retry: 151 151 err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf); 152 152 if (err) { 153 + const char *errstr = (err == -EBADMSG) ? " (ECC error)" : ""; 154 + 153 155 if (err == -EUCLEAN) { 154 156 /* 155 157 * -EUCLEAN is reported if there was a bit-flip which ··· 167 165 } 168 166 169 167 if (read != len && retries++ < UBI_IO_RETRIES) { 170 - dbg_io("error %d while reading %d bytes from PEB %d:%d," 168 + dbg_io("error %d%s while reading %d bytes from PEB %d:%d," 171 169 " read only %zd bytes, retry", 172 - err, len, pnum, offset, read); 170 + err, errstr, len, pnum, offset, read); 173 171 yield(); 174 172 goto retry; 175 173 } 176 174 177 - ubi_err("error %d while reading %d bytes from PEB %d:%d, " 178 - "read %zd bytes", err, len, pnum, offset, read); 175 + ubi_err("error %d%s while reading %d bytes from PEB %d:%d, " 176 + "read %zd bytes", err, errstr, len, pnum, offset, read); 179 177 ubi_dbg_dump_stack(); 180 178 181 179 /* ··· 517 515 * In this case we probably anyway have garbage in this PEB. 518 516 */ 519 517 err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); 520 - if (err1 == UBI_IO_BAD_VID_HDR) 518 + if (err1 == UBI_IO_BAD_HDR_READ || err1 == UBI_IO_BAD_HDR) 521 519 /* 522 520 * The VID header is corrupted, so we can safely erase this 523 521 * PEB and not afraid that it will be treated as a valid PEB in ··· 711 709 * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected 712 710 * and corrected by the flash driver; this is harmless but may indicate that 713 711 * this eraseblock may become bad soon (but may be not); 714 - * o %UBI_IO_BAD_EC_HDR if the erase counter header is corrupted (a CRC error); 712 + * o %UBI_IO_BAD_HDR if the erase counter header is corrupted (a CRC error); 715 713 * o %UBI_IO_PEB_EMPTY if the physical eraseblock is empty; 716 714 * o a negative error code in case of failure. 717 715 */ ··· 738 736 * header is still OK, we just report this as there was a 739 737 * bit-flip. 740 738 */ 741 - read_err = err; 739 + if (err == -EBADMSG) 740 + read_err = UBI_IO_BAD_HDR_READ; 742 741 } 743 742 744 743 magic = be32_to_cpu(ec_hdr->magic); 745 744 if (magic != UBI_EC_HDR_MAGIC) { 745 + if (read_err) 746 + return read_err; 747 + 746 748 /* 747 749 * The magic field is wrong. Let's check if we have read all 748 750 * 0xFF. If yes, this physical eraseblock is assumed to be 749 751 * empty. 750 - * 751 - * But if there was a read error, we do not test it for all 752 - * 0xFFs. Even if it does contain all 0xFFs, this error 753 - * indicates that something is still wrong with this physical 754 - * eraseblock and we anyway cannot treat it as empty. 755 752 */ 756 - if (read_err != -EBADMSG && 757 - check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { 753 + if (check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { 758 754 /* The physical eraseblock is supposedly empty */ 759 755 if (verbose) 760 756 ubi_warn("no EC header found at PEB %d, " ··· 774 774 } else if (UBI_IO_DEBUG) 775 775 dbg_msg("bad magic number at PEB %d: %08x instead of " 776 776 "%08x", pnum, magic, UBI_EC_HDR_MAGIC); 777 - return UBI_IO_BAD_EC_HDR; 777 + return UBI_IO_BAD_HDR; 778 778 } 779 779 780 780 crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); ··· 788 788 } else if (UBI_IO_DEBUG) 789 789 dbg_msg("bad EC header CRC at PEB %d, calculated " 790 790 "%#08x, read %#08x", pnum, crc, hdr_crc); 791 - return UBI_IO_BAD_EC_HDR; 791 + return read_err ?: UBI_IO_BAD_HDR; 792 792 } 793 793 794 794 /* And of course validate what has just been read from the media */ ··· 798 798 return -EINVAL; 799 799 } 800 800 801 + /* 802 + * If there was %-EBADMSG, but the header CRC is still OK, report about 803 + * a bit-flip to force scrubbing on this PEB. 804 + */ 801 805 return read_err ? UBI_IO_BITFLIPS : 0; 802 806 } 803 807 ··· 981 977 * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected 982 978 * and corrected by the flash driver; this is harmless but may indicate that 983 979 * this eraseblock may become bad soon; 984 - * o %UBI_IO_BAD_VID_HDR if the volume identifier header is corrupted (a CRC 980 + * o %UBI_IO_BAD_HDR if the volume identifier header is corrupted (a CRC 985 981 * error detected); 986 982 * o %UBI_IO_PEB_FREE if the physical eraseblock is free (i.e., there is no VID 987 983 * header there); ··· 1012 1008 * CRC check-sum and we will identify this. If the VID header is 1013 1009 * still OK, we just report this as there was a bit-flip. 1014 1010 */ 1015 - read_err = err; 1011 + if (err == -EBADMSG) 1012 + read_err = UBI_IO_BAD_HDR_READ; 1016 1013 } 1017 1014 1018 1015 magic = be32_to_cpu(vid_hdr->magic); 1019 1016 if (magic != UBI_VID_HDR_MAGIC) { 1017 + if (read_err) 1018 + return read_err; 1019 + 1020 1020 /* 1021 1021 * If we have read all 0xFF bytes, the VID header probably does 1022 1022 * not exist and the physical eraseblock is assumed to be free. 1023 - * 1024 - * But if there was a read error, we do not test the data for 1025 - * 0xFFs. Even if it does contain all 0xFFs, this error 1026 - * indicates that something is still wrong with this physical 1027 - * eraseblock and it cannot be regarded as free. 1028 1023 */ 1029 - if (read_err != -EBADMSG && 1030 - check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { 1024 + if (check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { 1031 1025 /* The physical eraseblock is supposedly free */ 1032 1026 if (verbose) 1033 1027 ubi_warn("no VID header found at PEB %d, " ··· 1047 1045 } else if (UBI_IO_DEBUG) 1048 1046 dbg_msg("bad magic number at PEB %d: %08x instead of " 1049 1047 "%08x", pnum, magic, UBI_VID_HDR_MAGIC); 1050 - return UBI_IO_BAD_VID_HDR; 1048 + return UBI_IO_BAD_HDR; 1051 1049 } 1052 1050 1053 1051 crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC); ··· 1061 1059 } else if (UBI_IO_DEBUG) 1062 1060 dbg_msg("bad CRC at PEB %d, calculated %#08x, " 1063 1061 "read %#08x", pnum, crc, hdr_crc); 1064 - return UBI_IO_BAD_VID_HDR; 1062 + return read_err ?: UBI_IO_BAD_HDR; 1065 1063 } 1066 1064 1067 1065 /* Validate the VID header that we have just read */ ··· 1071 1069 return -EINVAL; 1072 1070 } 1073 1071 1072 + /* 1073 + * If there was a read error (%-EBADMSG), but the header CRC is still 1074 + * OK, report about a bit-flip to force scrubbing on this PEB. 1075 + */ 1074 1076 return read_err ? UBI_IO_BITFLIPS : 0; 1075 1077 } 1076 1078
+101 -30
drivers/mtd/ubi/scan.c
··· 44 44 #include <linux/slab.h> 45 45 #include <linux/crc32.h> 46 46 #include <linux/math64.h> 47 + #include <linux/random.h> 47 48 #include "ubi.h" 48 49 49 50 #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID ··· 73 72 { 74 73 struct ubi_scan_leb *seb; 75 74 76 - if (list == &si->free) 75 + if (list == &si->free) { 77 76 dbg_bld("add to free: PEB %d, EC %d", pnum, ec); 78 - else if (list == &si->erase) 77 + si->free_peb_count += 1; 78 + } else if (list == &si->erase) { 79 79 dbg_bld("add to erase: PEB %d, EC %d", pnum, ec); 80 - else if (list == &si->corr) { 80 + si->erase_peb_count += 1; 81 + } else if (list == &si->corr) { 81 82 dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); 82 - si->corr_count += 1; 83 - } else if (list == &si->alien) 83 + si->corr_peb_count += 1; 84 + } else if (list == &si->alien) { 84 85 dbg_bld("add to alien: PEB %d, EC %d", pnum, ec); 85 - else 86 + si->alien_peb_count += 1; 87 + } else 86 88 BUG(); 87 89 88 90 seb = kmalloc(sizeof(struct ubi_scan_leb), GFP_KERNEL); ··· 521 517 sv->leb_count += 1; 522 518 rb_link_node(&seb->u.rb, parent, p); 523 519 rb_insert_color(&seb->u.rb, &sv->root); 520 + si->used_peb_count += 1; 524 521 return 0; 525 522 } 526 523 ··· 750 745 bitflips = 1; 751 746 else if (err == UBI_IO_PEB_EMPTY) 752 747 return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase); 753 - else if (err == UBI_IO_BAD_EC_HDR) { 748 + else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR) { 754 749 /* 755 750 * We have to also look at the VID header, possibly it is not 756 751 * corrupted. Set %bitflips flag in order to make this PEB be 757 752 * moved and EC be re-created. 758 753 */ 759 - ec_corr = 1; 754 + ec_corr = err; 760 755 ec = UBI_SCAN_UNKNOWN_EC; 761 756 bitflips = 1; 762 757 } 763 - 764 - si->is_empty = 0; 765 758 766 759 if (!ec_corr) { 767 760 int image_seq; ··· 816 813 return err; 817 814 else if (err == UBI_IO_BITFLIPS) 818 815 bitflips = 1; 819 - else if (err == UBI_IO_BAD_VID_HDR || 816 + else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR || 820 817 (err == UBI_IO_PEB_FREE && ec_corr)) { 821 818 /* VID header is corrupted */ 819 + if (err == UBI_IO_BAD_HDR_READ || 820 + ec_corr == UBI_IO_BAD_HDR_READ) 821 + si->read_err_count += 1; 822 822 err = add_to_list(si, pnum, ec, &si->corr); 823 823 if (err) 824 824 return err; ··· 842 836 switch (vidh->compat) { 843 837 case UBI_COMPAT_DELETE: 844 838 ubi_msg("\"delete\" compatible internal volume %d:%d" 845 - " found, remove it", vol_id, lnum); 839 + " found, will remove it", vol_id, lnum); 846 840 err = add_to_list(si, pnum, ec, &si->corr); 847 841 if (err) 848 842 return err; 849 - break; 843 + return 0; 850 844 851 845 case UBI_COMPAT_RO: 852 846 ubi_msg("read-only compatible internal volume %d:%d" ··· 861 855 err = add_to_list(si, pnum, ec, &si->alien); 862 856 if (err) 863 857 return err; 864 - si->alien_peb_count += 1; 865 858 return 0; 866 859 867 860 case UBI_COMPAT_REJECT: ··· 891 886 } 892 887 893 888 /** 889 + * check_what_we_have - check what PEB were found by scanning. 890 + * @ubi: UBI device description object 891 + * @si: scanning information 892 + * 893 + * This is a helper function which takes a look what PEBs were found by 894 + * scanning, and decides whether the flash is empty and should be formatted and 895 + * whether there are too many corrupted PEBs and we should not attach this 896 + * MTD device. Returns zero if we should proceed with attaching the MTD device, 897 + * and %-EINVAL if we should not. 898 + */ 899 + static int check_what_we_have(struct ubi_device *ubi, struct ubi_scan_info *si) 900 + { 901 + struct ubi_scan_leb *seb; 902 + int max_corr; 903 + 904 + max_corr = ubi->peb_count - si->bad_peb_count - si->alien_peb_count; 905 + max_corr = max_corr / 20 ?: 8; 906 + 907 + /* 908 + * Few corrupted PEBs are not a problem and may be just a result of 909 + * unclean reboots. However, many of them may indicate some problems 910 + * with the flash HW or driver. 911 + */ 912 + if (si->corr_peb_count >= 8) { 913 + ubi_warn("%d PEBs are corrupted", si->corr_peb_count); 914 + printk(KERN_WARNING "corrupted PEBs are:"); 915 + list_for_each_entry(seb, &si->corr, u.list) 916 + printk(KERN_CONT " %d", seb->pnum); 917 + printk(KERN_CONT "\n"); 918 + 919 + /* 920 + * If too many PEBs are corrupted, we refuse attaching, 921 + * otherwise, only print a warning. 922 + */ 923 + if (si->corr_peb_count >= max_corr) { 924 + ubi_err("too many corrupted PEBs, refusing this device"); 925 + return -EINVAL; 926 + } 927 + } 928 + 929 + if (si->free_peb_count + si->used_peb_count + 930 + si->alien_peb_count == 0) { 931 + /* No UBI-formatted eraseblocks were found */ 932 + if (si->corr_peb_count == si->read_err_count && 933 + si->corr_peb_count < 8) { 934 + /* No or just few corrupted PEBs, and all of them had a 935 + * read error. We assume that those are bad PEBs, which 936 + * were just not marked as bad so far. 937 + * 938 + * This piece of code basically tries to distinguish 939 + * between the following 2 situations: 940 + * 941 + * 1. Flash is empty, but there are few bad PEBs, which 942 + * are not marked as bad so far, and which were read 943 + * with error. We want to go ahead and format this 944 + * flash. While formating, the faulty PEBs will 945 + * probably be marked as bad. 946 + * 947 + * 2. Flash probably contains non-UBI data and we do 948 + * not want to format it and destroy possibly needed 949 + * data (e.g., consider the case when the bootloader 950 + * MTD partition was accidentally fed to UBI). 951 + */ 952 + si->is_empty = 1; 953 + ubi_msg("empty MTD device detected"); 954 + get_random_bytes(&ubi->image_seq, sizeof(ubi->image_seq)); 955 + } else { 956 + ubi_err("MTD device possibly contains non-UBI data, " 957 + "refusing it"); 958 + return -EINVAL; 959 + } 960 + } 961 + 962 + if (si->corr_peb_count > 0) 963 + ubi_msg("corrupted PEBs will be formatted"); 964 + return 0; 965 + } 966 + 967 + /** 894 968 * ubi_scan - scan an MTD device. 895 969 * @ubi: UBI device description object 896 970 * ··· 993 909 INIT_LIST_HEAD(&si->erase); 994 910 INIT_LIST_HEAD(&si->alien); 995 911 si->volumes = RB_ROOT; 996 - si->is_empty = 1; 997 912 998 913 err = -ENOMEM; 999 914 ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); ··· 1018 935 if (si->ec_count) 1019 936 si->mean_ec = div_u64(si->ec_sum, si->ec_count); 1020 937 1021 - if (si->is_empty) 1022 - ubi_msg("empty MTD device detected"); 1023 - 1024 - /* 1025 - * Few corrupted PEBs are not a problem and may be just a result of 1026 - * unclean reboots. However, many of them may indicate some problems 1027 - * with the flash HW or driver. Print a warning in this case. 1028 - */ 1029 - if (si->corr_count >= 8 || si->corr_count >= ubi->peb_count / 4) { 1030 - ubi_warn("%d PEBs are corrupted", si->corr_count); 1031 - printk(KERN_WARNING "corrupted PEBs are:"); 1032 - list_for_each_entry(seb, &si->corr, u.list) 1033 - printk(KERN_CONT " %d", seb->pnum); 1034 - printk(KERN_CONT "\n"); 1035 - } 938 + err = check_what_we_have(ubi, si); 939 + if (err) 940 + goto out_vidh; 1036 941 1037 942 /* 1038 943 * In case of unknown erase counter we use the mean erase counter
+14 -5
drivers/mtd/ubi/scan.h
··· 91 91 * @erase: list of physical eraseblocks which have to be erased 92 92 * @alien: list of physical eraseblocks which should not be used by UBI (e.g., 93 93 * those belonging to "preserve"-compatible internal volumes) 94 + * @used_peb_count: count of used PEBs 95 + * @corr_peb_count: count of PEBs in the @corr list 96 + * @read_err_count: count of PEBs read with error (%UBI_IO_BAD_HDR_READ was 97 + * returned) 98 + * @free_peb_count: count of PEBs in the @free list 99 + * @erase_peb_count: count of PEBs in the @erase list 100 + * @alien_peb_count: count of PEBs in the @alien list 94 101 * @bad_peb_count: count of bad physical eraseblocks 95 102 * @vols_found: number of volumes found during scanning 96 103 * @highest_vol_id: highest volume ID 97 - * @alien_peb_count: count of physical eraseblocks in the @alien list 98 104 * @is_empty: flag indicating whether the MTD device is empty or not 99 105 * @min_ec: lowest erase counter value 100 106 * @max_ec: highest erase counter value ··· 108 102 * @mean_ec: mean erase counter value 109 103 * @ec_sum: a temporary variable used when calculating @mean_ec 110 104 * @ec_count: a temporary variable used when calculating @mean_ec 111 - * @corr_count: count of corrupted PEBs 112 105 * 113 106 * This data structure contains the result of scanning and may be used by other 114 107 * UBI sub-systems to build final UBI data structures, further error-recovery ··· 119 114 struct list_head free; 120 115 struct list_head erase; 121 116 struct list_head alien; 117 + int used_peb_count; 118 + int corr_peb_count; 119 + int read_err_count; 120 + int free_peb_count; 121 + int erase_peb_count; 122 + int alien_peb_count; 122 123 int bad_peb_count; 123 124 int vols_found; 124 125 int highest_vol_id; 125 - int alien_peb_count; 126 126 int is_empty; 127 127 int min_ec; 128 128 int max_ec; ··· 135 125 int mean_ec; 136 126 uint64_t ec_sum; 137 127 int ec_count; 138 - int corr_count; 139 128 }; 140 129 141 130 struct ubi_device; ··· 144 135 * ubi_scan_move_to_list - move a PEB from the volume tree to a list. 145 136 * 146 137 * @sv: volume scanning information 147 - * @seb: scanning eraseblock infprmation 138 + * @seb: scanning eraseblock information 148 139 * @list: the list to move to 149 140 */ 150 141 static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv,
+5 -5
drivers/mtd/ubi/ubi.h
··· 89 89 * %0xFF bytes 90 90 * UBI_IO_PEB_FREE: the physical eraseblock is free, i.e. it contains only a 91 91 * valid erase counter header, and the rest are %0xFF bytes 92 - * UBI_IO_BAD_EC_HDR: the erase counter header is corrupted (bad magic or CRC) 93 - * UBI_IO_BAD_VID_HDR: the volume identifier header is corrupted (bad magic or 94 - * CRC) 92 + * UBI_IO_BAD_HDR: the EC or VID header is corrupted (bad magic or CRC) 93 + * UBI_IO_BAD_HDR_READ: the same as %UBI_IO_BAD_HDR, but also there was a read 94 + * error reported by the flash driver 95 95 * UBI_IO_BITFLIPS: bit-flips were detected and corrected 96 96 */ 97 97 enum { 98 98 UBI_IO_PEB_EMPTY = 1, 99 99 UBI_IO_PEB_FREE, 100 - UBI_IO_BAD_EC_HDR, 101 - UBI_IO_BAD_VID_HDR, 100 + UBI_IO_BAD_HDR, 101 + UBI_IO_BAD_HDR_READ, 102 102 UBI_IO_BITFLIPS 103 103 }; 104 104