lkml.org 
[lkml]   [2018]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/8] ubi: fastmap: Fixup pool sizes for preseeded fastmaps
Date
A preseeded fastmap has, by definition, no dirty PEBs and therefore all
pools are empty. The creation tool can also not calculate the maximal
pool sizes. This means we have to set them during attach.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
drivers/mtd/ubi/fastmap.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index f40cd2b18d4c..0d1274b69274 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -620,8 +620,15 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,

pool_size = be16_to_cpu(fmpl->size);
wl_pool_size = be16_to_cpu(fmpl_wl->size);
- fm->max_pool_size = be16_to_cpu(fmpl->max_size);
- fm->max_wl_pool_size = be16_to_cpu(fmpl_wl->max_size);
+
+ if (fm->flags & UBI_FM_SB_PRESEEDED_FLG) {
+ fm->max_pool_size = ubi->fm_pool.max_size;
+ fm->max_wl_pool_size = ubi->fm_wl_pool.max_size;
+
+ } else {
+ fm->max_pool_size = be16_to_cpu(fmpl->max_size);
+ fm->max_wl_pool_size = be16_to_cpu(fmpl_wl->max_size);
+ }

if (pool_size > UBI_FM_MAX_POOL_SIZE || pool_size < 0) {
ubi_err(ubi, "bad pool size: %i", pool_size);
--
2.13.6
\
 
 \ /
  Last update: 2018-05-14 13:28    [W:0.130 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site