aboutsummaryrefslogtreecommitdiff
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorHeiner Litz2018-03-30 00:05:06 +0200
committerJens Axboe2018-03-29 17:29:09 -0600
commita38c78d82dd38ce178c994a777751fae61ae31c8 (patch)
tree5bf95545b8dcca5348b5fbdbeee79065756e79e1 /drivers/lightnvm
parent96257a8a7f3183613550c41a909819e028372b61 (diff)
lightnvm: fix bad block initialization
fix reading bad block device information to correctly setup the per line blk_bitmap during lightnvm initialization Signed-off-by: Heiner Litz <hlitz@ucsc.edu> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/pblk-init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 43b835678f48..ee936c1ff764 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -460,10 +460,11 @@ static int pblk_bb_line(struct pblk *pblk, struct pblk_line *line,
struct nvm_tgt_dev *dev = pblk->dev;
struct nvm_geo *geo = &dev->geo;
int i, bb_cnt = 0;
+ int blk_per_lun = geo->nr_chks * geo->plane_mode;
for (i = 0; i < blk_per_line; i++) {
struct pblk_lun *rlun = &pblk->luns[i];
- u8 *lun_bb_log = bb_log + i * blk_per_line;
+ u8 *lun_bb_log = bb_log + i * blk_per_lun;
if (lun_bb_log[line->id] == NVM_BLK_T_FREE)
continue;