diff options
author | Matias Bjørling <m@bjorling.me> | 2016-07-07 03:54:21 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-07-07 10:51:52 -0400 |
commit | 24d4a7d721484498462bc3117d6d5c88ca623574 (patch) | |
tree | 29394f10806cb19858cdae66d87f7509fdd2805d /drivers/lightnvm | |
parent | 855cdd2c0bff7dcf9337734dc5749d127ca05086 (diff) |
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: Javier Gonzalez <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r-- | drivers/lightnvm/gennvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index c65fb675e374..b74174c6d021 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c | |||
@@ -542,7 +542,7 @@ static void gen_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type) | |||
542 | return; | 542 | return; |
543 | } | 543 | } |
544 | 544 | ||
545 | lun = &gn->luns[ppa.g.lun * ppa.g.ch]; | 545 | lun = &gn->luns[(dev->luns_per_chnl * ppa.g.ch) + ppa.g.lun]; |
546 | blk = &lun->vlun.blocks[ppa.g.blk]; | 546 | blk = &lun->vlun.blocks[ppa.g.blk]; |
547 | 547 | ||
548 | /* will be moved to bb list on put_blk from target */ | 548 | /* will be moved to bb list on put_blk from target */ |