[GIT PULL 07/26] lightnvm: pblk: ensure that erase is chunk aligned

From: Matias BjÃrling
Date: Sat May 04 2019 - 14:40:24 EST


From: Igor Konopko <igor.j.konopko@xxxxxxxxx>

The sector bits in the erase command may be uninitialized are
uninitialized, causing the erase LBA to be unaligned to the chunk size.

This is unexpected situation, since erase shall always be chunk
aligned based on OCSSD the 2.0 specification.

Signed-off-by: Igor Konopko <igor.j.konopko@xxxxxxxxx>
Reviewed-by: Javier GonzÃlez <javier@xxxxxxxxxxx>
Reviewed-by: Hans Holmberg <hans.holmberg@xxxxxxxxxxxx>
Signed-off-by: Matias BjÃrling <mb@xxxxxxxxxxx>
---
drivers/lightnvm/pblk-map.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/lightnvm/pblk-map.c b/drivers/lightnvm/pblk-map.c
index 7fbc99b60cac..5408e32b2f13 100644
--- a/drivers/lightnvm/pblk-map.c
+++ b/drivers/lightnvm/pblk-map.c
@@ -162,6 +162,7 @@ int pblk_map_erase_rq(struct pblk *pblk, struct nvm_rq *rqd,

*erase_ppa = ppa_list[i];
erase_ppa->a.blk = e_line->id;
+ erase_ppa->a.reserved = 0;

spin_unlock(&e_line->lock);

--
2.19.1