mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] UBI: Fix invalidate_fastmap()
@ 2013-08-19 20:31 Richard Weinberger
  2013-08-20 15:00 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Weinberger @ 2013-08-19 20:31 UTC (permalink / raw)
  To: dedekind1; +Cc: dwmw2, linux-mtd, linux-kernel, Richard Weinberger

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>
[rw: I did not Cc -stable because fastmap is an experimental feature.]
---
 drivers/mtd/ubi/fastmap.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 1542751..f5aa4b0 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -1343,7 +1343,7 @@ out:
 static int invalidate_fastmap(struct ubi_device *ubi,
 			      struct ubi_fastmap_layout *fm)
 {
-	int ret, i;
+	int ret;
 	struct ubi_vid_hdr *vh;
 
 	ret = erase_block(ubi, fm->e[0]->pnum);
@@ -1360,9 +1360,6 @@ static int invalidate_fastmap(struct ubi_device *ubi,
 	vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi));
 	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;
 }
 
-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] UBI: Fix invalidate_fastmap()
  2013-08-19 20:31 [PATCH] UBI: Fix invalidate_fastmap() Richard Weinberger
@ 2013-08-20 15:00 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2013-08-20 15:00 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: dwmw2, linux-mtd, linux-kernel

On Mon, 2013-08-19 at 22:31 +0200, Richard Weinberger wrote:
> 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>

Pushed to linux-ubi.git, thanks!

-- 
Best Regards,
Artem Bityutskiy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-20 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19 20:31 [PATCH] UBI: Fix invalidate_fastmap() Richard Weinberger
2013-08-20 15:00 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®