summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2016-11-28 22:38:55 +0100
committerJens Axboe <axboe@fb.com>2016-11-29 12:12:51 -0700
commit8a3c95ab385fb98621455807ae52b4454192f8c5 (patch)
tree8ef1274d42b4d4034c09e9f752a688c0e1bd2b4f
parentbb3149792e0ed52cf5f457dda4c9bf9c5bda1542 (diff)
lightnvm: do not protect block 0
Device blocks should be marked by the device and considered as bad blocks by the media manager. Thus, do not make assumptions on which blocks are going to be used by the device. In doing so we might lose valid blocks from the free list. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/lightnvm/gennvm.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c
index 730d7361f870..a7e17faea2cd 100644
--- a/drivers/lightnvm/gennvm.c
+++ b/drivers/lightnvm/gennvm.c
@@ -371,12 +371,6 @@ static int gen_blocks_init(struct nvm_dev *dev, struct gen_dev *gn)
block->lun = &lun->vlun;
block->id = cur_block_id++;
- /* First block is reserved for device */
- if (unlikely(lun_iter == 0 && blk_iter == 0)) {
- lun->vlun.nr_free_blocks--;
- continue;
- }
-
list_add_tail(&block->list, &lun->free_list);
}