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

Commit 24d4a7d7 authored by Matias Bjørling's avatar Matias Bjørling Committed by Jens Axboe
Browse files

lightnvm: fix lun offset calculation for mark blk



The gen_mark_blk_bad function marks the wrong block when a block is on
a different channel. Fix the index calculation, so that it updates the
correct block.

Reported-by: default avatarJavier Gonzalez <javier@cnexlabs.com>
Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 855cdd2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -542,7 +542,7 @@ static void gen_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type)
		return;
		return;
	}
	}


	lun = &gn->luns[ppa.g.lun * ppa.g.ch];
	lun = &gn->luns[(dev->luns_per_chnl * ppa.g.ch) + ppa.g.lun];
	blk = &lun->vlun.blocks[ppa.g.blk];
	blk = &lun->vlun.blocks[ppa.g.blk];


	/* will be moved to bb list on put_blk from target */
	/* will be moved to bb list on put_blk from target */