Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a38c78d8 authored by Heiner Litz's avatar Heiner Litz Committed by Jens Axboe
Browse files

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: default avatarHeiner Litz <hlitz@ucsc.edu>
Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 96257a8a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;