stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* request for 4.14-stable: 25677478474a ("ubi: Initialize Fastmap checkmapping correctly")
@ 2018-12-01 19:47 Sudip Mukherjee
  2018-12-02 14:33 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2018-12-01 19:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, Lachmann, Juergen, Richard Weinberger

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

Hi Greg,

This was not marked for stable but the commit which it fixes has been
added to v4.14.85.

--
Regards
Sudip

[-- Attachment #2: 0001-ubi-Initialize-Fastmap-checkmapping-correctly.patch --]
[-- Type: text/x-diff, Size: 2029 bytes --]

>From a72f2dedb99e9839029091930865dadfd52372b7 Mon Sep 17 00:00:00 2001
From: Richard Weinberger <richard@nod.at>
Date: Tue, 12 Jun 2018 09:33:16 +0200
Subject: [PATCH] ubi: Initialize Fastmap checkmapping correctly

commit 25677478474a91fa1b46f19a4a591a9848bca6fb upstream

We cannot do it last, otherwithse it will be skipped for dynamic
volumes.

Reported-by: Lachmann, Juergen <juergen.lachmann@harman.com>
Fixes: 34653fd8c46e ("ubi: fastmap: Check each mapping only once")
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/mtd/ubi/vtbl.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index 94d7a865b135..7504f430c011 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -579,6 +579,16 @@ static int init_volumes(struct ubi_device *ubi,
 		reserved_pebs += vol->reserved_pebs;
 
 		/*
+		 * We use ubi->peb_count and not vol->reserved_pebs because
+		 * we want to keep the code simple. Otherwise we'd have to
+		 * resize/check the bitmap upon volume resize too.
+		 * Allocating a few bytes more does not hurt.
+		 */
+		err = ubi_fastmap_init_checkmap(vol, ubi->peb_count);
+		if (err)
+			return err;
+
+		/*
 		 * In case of dynamic volume UBI knows nothing about how many
 		 * data is stored there. So assume the whole volume is used.
 		 */
@@ -620,16 +630,6 @@ static int init_volumes(struct ubi_device *ubi,
 			(long long)(vol->used_ebs - 1) * vol->usable_leb_size;
 		vol->used_bytes += av->last_data_size;
 		vol->last_eb_bytes = av->last_data_size;
-
-		/*
-		 * We use ubi->peb_count and not vol->reserved_pebs because
-		 * we want to keep the code simple. Otherwise we'd have to
-		 * resize/check the bitmap upon volume resize too.
-		 * Allocating a few bytes more does not hurt.
-		 */
-		err = ubi_fastmap_init_checkmap(vol, ubi->peb_count);
-		if (err)
-			return err;
 	}
 
 	/* And add the layout volume */
-- 
2.11.0


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

* Re: request for 4.14-stable: 25677478474a ("ubi: Initialize Fastmap checkmapping correctly")
  2018-12-01 19:47 request for 4.14-stable: 25677478474a ("ubi: Initialize Fastmap checkmapping correctly") Sudip Mukherjee
@ 2018-12-02 14:33 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2018-12-02 14:33 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Greg Kroah-Hartman, stable, Lachmann, Juergen, Richard Weinberger

On Sat, Dec 01, 2018 at 07:47:49PM +0000, Sudip Mukherjee wrote:
>Hi Greg,
>
>This was not marked for stable but the commit which it fixes has been
>added to v4.14.85.

Queued for 4.14, thank you.

--
Thanks,
Sasha

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

end of thread, other threads:[~2018-12-02 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-01 19:47 request for 4.14-stable: 25677478474a ("ubi: Initialize Fastmap checkmapping correctly") Sudip Mukherjee
2018-12-02 14:33 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).