diff options
| -rw-r--r-- | drivers/mtd/ubi/attach.c | 28 | ||||
| -rw-r--r-- | drivers/mtd/ubi/build.c | 22 | ||||
| -rw-r--r-- | drivers/mtd/ubi/cdev.c | 9 | ||||
| -rw-r--r-- | drivers/mtd/ubi/debug.c | 4 | ||||
| -rw-r--r-- | drivers/mtd/ubi/eba.c | 33 | ||||
| -rw-r--r-- | drivers/mtd/ubi/gluebi.c | 28 | ||||
| -rw-r--r-- | drivers/mtd/ubi/io.c | 78 | ||||
| -rw-r--r-- | drivers/mtd/ubi/misc.c | 4 | ||||
| -rw-r--r-- | drivers/mtd/ubi/vtbl.c | 8 |
9 files changed, 101 insertions, 113 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 68d4d1f76d1e..d8e92b6a33f6 100644 --- a/drivers/mtd/ubi/attach.c +++ b/drivers/mtd/ubi/attach.c | |||
| @@ -378,8 +378,8 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb, | |||
| 378 | if (err == UBI_IO_BITFLIPS) | 378 | if (err == UBI_IO_BITFLIPS) |
| 379 | bitflips = 1; | 379 | bitflips = 1; |
| 380 | else { | 380 | else { |
| 381 | ubi_err("VID of PEB %d header is bad, but it " | 381 | ubi_err("VID of PEB %d header is bad, but it was OK earlier, err %d", |
| 382 | "was OK earlier, err %d", pnum, err); | 382 | pnum, err); |
| 383 | if (err > 0) | 383 | if (err > 0) |
| 384 | err = -EIO; | 384 | err = -EIO; |
| 385 | 385 | ||
| @@ -790,9 +790,9 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr, | |||
| 790 | if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size)) | 790 | if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size)) |
| 791 | goto out_unlock; | 791 | goto out_unlock; |
| 792 | 792 | ||
| 793 | ubi_err("PEB %d contains corrupted VID header, and the data does not " | 793 | ubi_err("PEB %d contains corrupted VID header, and the data does not contain all 0xFF", |
| 794 | "contain all 0xFF, this may be a non-UBI PEB or a severe VID " | 794 | pnum); |
| 795 | "header corruption which requires manual inspection", pnum); | 795 | ubi_err("this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection"); |
| 796 | ubi_dump_vid_hdr(vid_hdr); | 796 | ubi_dump_vid_hdr(vid_hdr); |
| 797 | dbg_msg("hexdump of PEB %d offset %d, length %d", | 797 | dbg_msg("hexdump of PEB %d offset %d, length %d", |
| 798 | pnum, ubi->leb_start, ubi->leb_size); | 798 | pnum, ubi->leb_start, ubi->leb_size); |
| @@ -907,8 +907,8 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai, | |||
| 907 | ubi->image_seq = image_seq; | 907 | ubi->image_seq = image_seq; |
| 908 | if (ubi->image_seq && image_seq && | 908 | if (ubi->image_seq && image_seq && |
| 909 | ubi->image_seq != image_seq) { | 909 | ubi->image_seq != image_seq) { |
| 910 | ubi_err("bad image sequence number %d in PEB %d, " | 910 | ubi_err("bad image sequence number %d in PEB %d, expected %d", |
| 911 | "expected %d", image_seq, pnum, ubi->image_seq); | 911 | image_seq, pnum, ubi->image_seq); |
| 912 | ubi_dump_ec_hdr(ech); | 912 | ubi_dump_ec_hdr(ech); |
| 913 | return -EINVAL; | 913 | return -EINVAL; |
| 914 | } | 914 | } |
| @@ -997,8 +997,8 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai, | |||
| 997 | /* Unsupported internal volume */ | 997 | /* Unsupported internal volume */ |
| 998 | switch (vidh->compat) { | 998 | switch (vidh->compat) { |
| 999 | case UBI_COMPAT_DELETE: | 999 | case UBI_COMPAT_DELETE: |
| 1000 | ubi_msg("\"delete\" compatible internal volume %d:%d" | 1000 | ubi_msg("\"delete\" compatible internal volume %d:%d found, will remove it", |
| 1001 | " found, will remove it", vol_id, lnum); | 1001 | vol_id, lnum); |
| 1002 | err = add_to_list(ai, pnum, vol_id, lnum, | 1002 | err = add_to_list(ai, pnum, vol_id, lnum, |
| 1003 | ec, 1, &ai->erase); | 1003 | ec, 1, &ai->erase); |
| 1004 | if (err) | 1004 | if (err) |
| @@ -1006,15 +1006,14 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai, | |||
| 1006 | return 0; | 1006 | return 0; |
| 1007 | 1007 | ||
| 1008 | case UBI_COMPAT_RO: | 1008 | case UBI_COMPAT_RO: |
| 1009 | ubi_msg("read-only compatible internal volume %d:%d" | 1009 | ubi_msg("read-only compatible internal volume %d:%d found, switch to read-only mode", |
| 1010 | " found, switch to read-only mode", | ||
| 1011 | vol_id, lnum); | 1010 | vol_id, lnum); |
| 1012 | ubi->ro_mode = 1; | 1011 | ubi->ro_mode = 1; |
| 1013 | break; | 1012 | break; |
| 1014 | 1013 | ||
| 1015 | case UBI_COMPAT_PRESERVE: | 1014 | case UBI_COMPAT_PRESERVE: |
| 1016 | ubi_msg("\"preserve\" compatible internal volume %d:%d" | 1015 | ubi_msg("\"preserve\" compatible internal volume %d:%d found", |
| 1017 | " found", vol_id, lnum); | 1016 | vol_id, lnum); |
| 1018 | err = add_to_list(ai, pnum, vol_id, lnum, | 1017 | err = add_to_list(ai, pnum, vol_id, lnum, |
| 1019 | ec, 0, &ai->alien); | 1018 | ec, 0, &ai->alien); |
| 1020 | if (err) | 1019 | if (err) |
| @@ -1112,8 +1111,7 @@ static int late_analysis(struct ubi_device *ubi, struct ubi_attach_info *ai) | |||
| 1112 | get_random_bytes(&ubi->image_seq, | 1111 | get_random_bytes(&ubi->image_seq, |
| 1113 | sizeof(ubi->image_seq)); | 1112 | sizeof(ubi->image_seq)); |
| 1114 | } else { | 1113 | } else { |
| 1115 | ubi_err("MTD device is not UBI-formatted and possibly " | 1114 | ubi_err("MTD device is not UBI-formatted and possibly contains non-UBI data - refusing it"); |
| 1116 | "contains non-UBI data - refusing it"); | ||
| 1117 | return -EINVAL; | 1115 | return -EINVAL; |
| 1118 | } | 1116 | } |
| 1119 | 1117 | ||
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 89660881aa31..dd9bc0a5cc31 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
| @@ -748,16 +748,15 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024) | |||
| 748 | * read-only mode. | 748 | * read-only mode. |
| 749 | */ | 749 | */ |
| 750 | if (ubi->vid_hdr_offset + UBI_VID_HDR_SIZE <= ubi->hdrs_min_io_size) { | 750 | if (ubi->vid_hdr_offset + UBI_VID_HDR_SIZE <= ubi->hdrs_min_io_size) { |
| 751 | ubi_warn("EC and VID headers are in the same minimal I/O unit, " | 751 | ubi_warn("EC and VID headers are in the same minimal I/O unit, switch to read-only mode"); |
| 752 | "switch to read-only mode"); | ||
| 753 | ubi->ro_mode = 1; | 752 | ubi->ro_mode = 1; |
| 754 | } | 753 | } |
| 755 | 754 | ||
| 756 | ubi->leb_size = ubi->peb_size - ubi->leb_start; | 755 | ubi->leb_size = ubi->peb_size - ubi->leb_start; |
| 757 | 756 | ||
| 758 | if (!(ubi->mtd->flags & MTD_WRITEABLE)) { | 757 | if (!(ubi->mtd->flags & MTD_WRITEABLE)) { |
| 759 | ubi_msg("MTD device %d is write-protected, attach in " | 758 | ubi_msg("MTD device %d is write-protected, attach in read-only mode", |
| 760 | "read-only mode", ubi->mtd->index); | 759 | ubi->mtd->index); |
| 761 | ubi->ro_mode = 1; | 760 | ubi->ro_mode = 1; |
| 762 | } | 761 | } |
| 763 | 762 | ||
| @@ -892,8 +891,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, | |||
| 892 | * no sense to attach emulated MTD devices, so we prohibit this. | 891 | * no sense to attach emulated MTD devices, so we prohibit this. |
| 893 | */ | 892 | */ |
| 894 | if (mtd->type == MTD_UBIVOLUME) { | 893 | if (mtd->type == MTD_UBIVOLUME) { |
| 895 | ubi_err("refuse attaching mtd%d - it is already emulated on " | 894 | ubi_err("refuse attaching mtd%d - it is already emulated on top of UBI", |
| 896 | "top of UBI", mtd->index); | 895 | mtd->index); |
| 897 | return -EINVAL; | 896 | return -EINVAL; |
| 898 | } | 897 | } |
| 899 | 898 | ||
| @@ -1357,14 +1356,13 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) | |||
| 1357 | 1356 | ||
| 1358 | len = strnlen(val, MTD_PARAM_LEN_MAX); | 1357 | len = strnlen(val, MTD_PARAM_LEN_MAX); |
| 1359 | if (len == MTD_PARAM_LEN_MAX) { | 1358 | if (len == MTD_PARAM_LEN_MAX) { |
| 1360 | printk(KERN_ERR "UBI error: parameter \"%s\" is too long, " | 1359 | printk(KERN_ERR "UBI error: parameter \"%s\" is too long, max. is %d\n", |
| 1361 | "max. is %d\n", val, MTD_PARAM_LEN_MAX); | 1360 | val, MTD_PARAM_LEN_MAX); |
| 1362 | return -EINVAL; | 1361 | return -EINVAL; |
| 1363 | } | 1362 | } |
| 1364 | 1363 | ||
| 1365 | if (len == 0) { | 1364 | if (len == 0) { |
| 1366 | printk(KERN_WARNING "UBI warning: empty 'mtd=' parameter - " | 1365 | printk(KERN_WARNING "UBI warning: empty 'mtd=' parameter - ignored\n"); |
| 1367 | "ignored\n"); | ||
| 1368 | return 0; | 1366 | return 0; |
| 1369 | } | 1367 | } |
| 1370 | 1368 | ||
| @@ -1396,8 +1394,8 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) | |||
| 1396 | int err = kstrtoint(tokens[2], 10, &p->max_beb_per1024); | 1394 | int err = kstrtoint(tokens[2], 10, &p->max_beb_per1024); |
| 1397 | 1395 | ||
| 1398 | if (err) { | 1396 | if (err) { |
| 1399 | printk(KERN_ERR "UBI error: bad value for " | 1397 | printk(KERN_ERR "UBI error: bad value for max_beb_per1024 parameter: %s", |
| 1400 | "max_beb_per1024 parameter: %s", tokens[2]); | 1398 | tokens[2]); |
| 1401 | return -EINVAL; | 1399 | return -EINVAL; |
| 1402 | } | 1400 | } |
| 1403 | } | 1401 | } |
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 7885dc0934ce..540d2db492ee 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
| @@ -140,9 +140,9 @@ static int vol_cdev_release(struct inode *inode, struct file *file) | |||
| 140 | vol->updating = 0; | 140 | vol->updating = 0; |
| 141 | vfree(vol->upd_buf); | 141 | vfree(vol->upd_buf); |
| 142 | } else if (vol->changing_leb) { | 142 | } else if (vol->changing_leb) { |
| 143 | dbg_gen("only %lld of %lld bytes received for atomic LEB change" | 143 | dbg_gen("only %lld of %lld bytes received for atomic LEB change for volume %d:%d, cancel", |
| 144 | " for volume %d:%d, cancel", vol->upd_received, | 144 | vol->u |
