Skip to content

Commit

Permalink
lightnvm: fix lun offset calculation for mark blk
Browse files Browse the repository at this point in the history
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: Javier Gonzalez <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Matias Bjørling authored and Jens Axboe committed Jul 7, 2016
1 parent 855cdd2 commit 24d4a7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/lightnvm/gennvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static void gen_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type)
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];

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

0 comments on commit 24d4a7d

Please sign in to comment.