From: Igor Konopko Date: Sat, 4 May 2019 18:37:52 +0000 (+0200) Subject: lightnvm: pblk: ensure that erase is chunk aligned X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=75c89bef6a54943ea0053dc3d27479edfb31b699;p=openwrt%2Fstaging%2Fblogic.git lightnvm: pblk: ensure that erase is chunk aligned 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 Reviewed-by: Javier González Reviewed-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- 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);