diff options
author | Richard Weinberger <richard@nod.at> | 2013-08-19 16:31:49 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2013-08-20 10:53:25 -0400 |
commit | 8930fa500f55215f0211db9b78255e727ac3f282 (patch) | |
tree | d42b70f388fa4c56bcfb821b026f7312b18d86ff | |
parent | 5ef4414f4bc26a19cfd5cd11aee9697a863e4d51 (diff) |
UBI: Fix invalidate_fastmap()
Onging tests uncovered that invalidate_fastmap() is broken.
It must not call ubi_wl_put_fm_peb() because all PEBs used
by the old fastmap have already been put back.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | drivers/mtd/ubi/fastmap.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 154275182b4b..f5aa4b02cfa6 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c | |||
@@ -1343,7 +1343,7 @@ out: | |||
1343 | static int invalidate_fastmap(struct ubi_device *ubi, | 1343 | static int invalidate_fastmap(struct ubi_device *ubi, |
1344 | struct ubi_fastmap_layout *fm) | 1344 | struct ubi_fastmap_layout *fm) |
1345 | { | 1345 | { |
1346 | int ret, i; | 1346 | int ret; |
1347 | struct ubi_vid_hdr *vh; | 1347 | struct ubi_vid_hdr *vh; |
1348 | 1348 | ||
1349 | ret = erase_block(ubi, fm->e[0]->pnum); | 1349 | ret = erase_block(ubi, fm->e[0]->pnum); |
@@ -1360,9 +1360,6 @@ static int invalidate_fastmap(struct ubi_device *ubi, | |||
1360 | vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi)); | 1360 | vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi)); |
1361 | ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh); | 1361 | ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh); |
1362 | 1362 | ||
1363 | for (i = 0; i < fm->used_blocks; i++) | ||
1364 | ubi_wl_put_fm_peb(ubi, fm->e[i], i, fm->to_be_tortured[i]); | ||
1365 | |||
1366 | return ret; | 1363 | return ret; |
1367 | } | 1364 | } |
1368 | 1365 | ||