diff options
| author | Dmitry Shmidt <dimitrysh@google.com> | 2016-11-15 17:02:38 -0800 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2016-11-15 17:02:38 -0800 |
| commit | 324e88de4aba3b6d4e0453fb2adb094e4a53754c (patch) | |
| tree | f961e8c1eb2bcdefec062e0b86d4b5f307caee1e /drivers/mtd/ubi/fastmap.c | |
| parent | 93e3336909d88c3afca7ccdc8b009c435f37a70a (diff) | |
| parent | 4dab3e4df9944782cb3c229bd37f5ea8b5f52bac (diff) | |
Merge tag 'v4.4.32' into android-4.4.y
This is the 4.4.32 stable release
Change-Id: I5028402eadfcf055ac44a5e67abc6da75b2068b3
Diffstat (limited to 'drivers/mtd/ubi/fastmap.c')
| -rw-r--r-- | drivers/mtd/ubi/fastmap.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 990898b9dc72..bba7dd1b5ebf 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -513,10 +513,11 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai, unsigned long long ec = be64_to_cpu(ech->ec); unmap_peb(ai, pnum); dbg_bld("Adding PEB to free: %i", pnum); + if (err == UBI_IO_FF_BITFLIPS) - add_aeb(ai, free, pnum, ec, 1); - else - add_aeb(ai, free, pnum, ec, 0); + scrub = 1; + + add_aeb(ai, free, pnum, ec, scrub); continue; } else if (err == 0 || err == UBI_IO_BITFLIPS) { dbg_bld("Found non empty PEB:%i in pool", pnum); @@ -748,11 +749,11 @@ static int ubi_attach_fastmap(struct ubi_device *ubi, fmvhdr->vol_type, be32_to_cpu(fmvhdr->last_eb_bytes)); - if (!av) - goto fail_bad; - if (PTR_ERR(av) == -EINVAL) { - ubi_err(ubi, "volume (ID %i) already exists", - fmvhdr->vol_id); + if (IS_ERR(av)) { + if (PTR_ERR(av) == -EEXIST) + ubi_err(ubi, "volume (ID %i) already exists", + fmvhdr->vol_id); + goto fail_bad; } |
