Skip to content

Commit f635210

Browse files
Hans Holmbergaxboe
authored andcommitted
lightnvm: pblk: assume that chunks are closed on 1.2 devices
We can't know if a block is closed or not on 1.2 devices, so assume closed state to make sure that blocks are erased before writing. Fixes: 32ef941 ("lightnvm: pblk: implement get log report chunk") Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 11f6ad6 commit f635210

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/lightnvm/pblk-init.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,10 +719,11 @@ static int pblk_setup_line_meta_12(struct pblk *pblk, struct pblk_line *line,
719719

720720
/*
721721
* In 1.2 spec. chunk state is not persisted by the device. Thus
722-
* some of the values are reset each time pblk is instantiated.
722+
* some of the values are reset each time pblk is instantiated,
723+
* so we have to assume that the block is closed.
723724
*/
724725
if (lun_bb_meta[line->id] == NVM_BLK_T_FREE)
725-
chunk->state = NVM_CHK_ST_FREE;
726+
chunk->state = NVM_CHK_ST_CLOSED;
726727
else
727728
chunk->state = NVM_CHK_ST_OFFLINE;
728729

0 commit comments

Comments
 (0)