Thread (10 messages) 10 messages, 4 authors, 2018-06-26

Re: [PATCH] lightnvm: pblk: assume that chunks are closed on 1.2 devices

From: Matias Bjørling <hidden>
Date: 2018-06-26 12:10:45
Also in: lkml

On 06/19/2018 11:06 AM, Hans Holmberg wrote:
quoted hunk ↗ jump to hunk
From: Hans Holmberg <redacted>

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: 32ef9412c114 ("lightnvm: pblk: implement get log report chunk")

Signed-off-by: Hans Holmberg <redacted>
---

This patch applies on:
ssh://github.com/OpenChannelSSD/linux branch for-4.19/core

  drivers/lightnvm/pblk-init.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index aa24264..3b8aa4a 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -717,10 +717,11 @@ static int pblk_setup_line_meta_12(struct pblk *pblk, struct pblk_line *line,
  
  		/*
  		 * In 1.2 spec. chunk state is not persisted by the device. Thus
-		 * some of the values are reset each time pblk is instantiated.
+		 * some of the values are reset each time pblk is instantiated,
+		 * so we have to assume that the block is closed.
  		 */
  		if (lun_bb_meta[line->id] == NVM_BLK_T_FREE)
-			chunk->state =  NVM_CHK_ST_FREE;
+			chunk->state =  NVM_CHK_ST_CLOSED;
  		else
  			chunk->state = NVM_CHK_ST_OFFLINE;
  
Hi Jens,

Would it be possible to pick this patch up for 4.18? It is a temporary 
fix that lets pblk continue to work with 1.2 OCSSD drives that has open 
blocks on initialization. Without it, writes will fail, as pblk assumes 
that the blocks are free.

A proper fix that scans the block state on initialization will be ready 
for 4.19.

Thank you,
Matias
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help