lightnvm: pblk: ensure that erase is chunk aligned
authorIgor Konopko <igor.j.konopko@intel.com>
Sat, 4 May 2019 18:37:52 +0000 (20:37 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 May 2019 16:19:17 +0000 (10:19 -0600)
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@intel.com>
Reviewed-by: Javier González <javier@javigon.com>
Reviewed-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-map.c

index 7fbc99b60cac58da8c20af27c9010d3a7b8d7ea1..5408e32b2f13df6b5fef28573bbe2576c161c79f 100644 (file)
@@ -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);