diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/mtd/ubi/vmt.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r-- | drivers/mtd/ubi/vmt.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index e42afab9a9fe..366eb70219a6 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include "ubi.h" | 29 | #include "ubi.h" |
30 | 30 | ||
31 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID | 31 | #ifdef CONFIG_MTD_UBI_DEBUG |
32 | static int paranoid_check_volumes(struct ubi_device *ubi); | 32 | static int paranoid_check_volumes(struct ubi_device *ubi); |
33 | #else | 33 | #else |
34 | #define paranoid_check_volumes(ubi) 0 | 34 | #define paranoid_check_volumes(ubi) 0 |
@@ -261,6 +261,9 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
261 | /* Reserve physical eraseblocks */ | 261 | /* Reserve physical eraseblocks */ |
262 | if (vol->reserved_pebs > ubi->avail_pebs) { | 262 | if (vol->reserved_pebs > ubi->avail_pebs) { |
263 | dbg_err("not enough PEBs, only %d available", ubi->avail_pebs); | 263 | dbg_err("not enough PEBs, only %d available", ubi->avail_pebs); |
264 | if (ubi->corr_peb_count) | ||
265 | dbg_err("%d PEBs are corrupted and not used", | ||
266 | ubi->corr_peb_count); | ||
264 | err = -ENOSPC; | 267 | err = -ENOSPC; |
265 | goto out_unlock; | 268 | goto out_unlock; |
266 | } | 269 | } |
@@ -527,6 +530,9 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) | |||
527 | if (pebs > ubi->avail_pebs) { | 530 | if (pebs > ubi->avail_pebs) { |
528 | dbg_err("not enough PEBs: requested %d, available %d", | 531 | dbg_err("not enough PEBs: requested %d, available %d", |
529 | pebs, ubi->avail_pebs); | 532 | pebs, ubi->avail_pebs); |
533 | if (ubi->corr_peb_count) | ||
534 | dbg_err("%d PEBs are corrupted and not used", | ||
535 | ubi->corr_peb_count); | ||
530 | spin_unlock(&ubi->volumes_lock); | 536 | spin_unlock(&ubi->volumes_lock); |
531 | err = -ENOSPC; | 537 | err = -ENOSPC; |
532 | goto out_free; | 538 | goto out_free; |
@@ -705,7 +711,7 @@ void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol) | |||
705 | volume_sysfs_close(vol); | 711 | volume_sysfs_close(vol); |
706 | } | 712 | } |
707 | 713 | ||
708 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID | 714 | #ifdef CONFIG_MTD_UBI_DEBUG |
709 | 715 | ||
710 | /** | 716 | /** |
711 | * paranoid_check_volume - check volume information. | 717 | * paranoid_check_volume - check volume information. |
@@ -784,11 +790,6 @@ static int paranoid_check_volume(struct ubi_device *ubi, int vol_id) | |||
784 | goto fail; | 790 | goto fail; |
785 | } | 791 | } |
786 | 792 | ||
787 | if (!vol->name) { | ||
788 | ubi_err("NULL volume name"); | ||
789 | goto fail; | ||
790 | } | ||
791 | |||
792 | n = strnlen(vol->name, vol->name_len + 1); | 793 | n = strnlen(vol->name, vol->name_len + 1); |
793 | if (n != vol->name_len) { | 794 | if (n != vol->name_len) { |
794 | ubi_err("bad name_len %lld", n); | 795 | ubi_err("bad name_len %lld", n); |
@@ -870,6 +871,9 @@ static int paranoid_check_volumes(struct ubi_device *ubi) | |||
870 | { | 871 | { |
871 | int i, err = 0; | 872 | int i, err = 0; |
872 | 873 | ||
874 | if (!(ubi_chk_flags & UBI_CHK_GEN)) | ||
875 | return 0; | ||
876 | |||
873 | for (i = 0; i < ubi->vtbl_slots; i++) { | 877 | for (i = 0; i < ubi->vtbl_slots; i++) { |
874 | err = paranoid_check_volume(ubi, i); | 878 | err = paranoid_check_volume(ubi, i); |
875 | if (err) | 879 | if (err) |