lkml.org 
[lkml]   [2017]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[GIT PULL 38/58] lightnvm: pblk: ensure right bad block calculation
Date
From: Javier González <javier@cnexlabs.com>

Make sure that the variable controlling block threshold for allocating
extra metadata sectors in case of a line with bad blocks does not get a
negative value. Otherwise, the line will be marked as corrupted and
wasted.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
---
drivers/lightnvm/pblk-init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 3c37491..c7239c4 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -710,7 +710,7 @@ static int pblk_lines_init(struct pblk *pblk)
goto add_emeta_page;
}

- lm->emeta_bb = geo->nr_luns - i;
+ lm->emeta_bb = geo->nr_luns > i ? geo->nr_luns - i : 0;

lm->min_blk_line = 1;
if (geo->nr_luns > 1)
--
2.9.3
\
 
 \ /
  Last update: 2017-10-13 14:48    [W:0.311 / U:2.512 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site