Commit 8930fa50 authored by Richard Weinberger's avatar Richard Weinberger Committed by Artem Bityutskiy

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: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 5ef4414f
...@@ -1343,7 +1343,7 @@ static int erase_block(struct ubi_device *ubi, int pnum) ...@@ -1343,7 +1343,7 @@ static int erase_block(struct ubi_device *ubi, int pnum)
static int invalidate_fastmap(struct ubi_device *ubi, static int invalidate_fastmap(struct ubi_device *ubi,
struct ubi_fastmap_layout *fm) struct ubi_fastmap_layout *fm)
{ {
int ret, i; int ret;
struct ubi_vid_hdr *vh; struct ubi_vid_hdr *vh;
ret = erase_block(ubi, fm->e[0]->pnum); ret = erase_block(ubi, fm->e[0]->pnum);
...@@ -1360,9 +1360,6 @@ static int invalidate_fastmap(struct ubi_device *ubi, ...@@ -1360,9 +1360,6 @@ static int invalidate_fastmap(struct ubi_device *ubi,
vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi)); vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi));
ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh); ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh);
for (i = 0; i < fm->used_blocks; i++)
ubi_wl_put_fm_peb(ubi, fm->e[i], i, fm->to_be_tortured[i]);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment