diff options
author | Matias Bjørling <mb@lightnvm.io> | 2018-10-09 14:11:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-24 10:20:50 +0300 |
commit | c7e49f73152f246925285814a8b7dee5abbe944f (patch) | |
tree | 599754c310478687b0c205a428cc1902ebc95cec | |
parent | ced6b5dae1dcfc451926890a91dafcd958464ce6 (diff) | |
download | linux-c7e49f73152f246925285814a8b7dee5abbe944f.tar.xz |
lightnvm: pblk: fix incorrect min_write_pgs
[ Upstream commit 8bbd45d02a118cbefdf4e1a6274bd965a6aa3c59 ]
The calculation of pblk->min_write_pgs should only use the optimal
write size attribute provided by the drive, it does not correlate to
the memory page size of the system, which can be smaller or larger
than the LBA size reported.
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/lightnvm/pblk-init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 537e98f2b24a..145922589b0c 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -371,7 +371,7 @@ static int pblk_core_init(struct pblk *pblk) atomic64_set(&pblk->nr_flush, 0); pblk->nr_flush_rst = 0; - pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE); + pblk->min_write_pgs = geo->ws_opt; max_write_ppas = pblk->min_write_pgs * geo->all_luns; pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA); pblk_set_sec_per_write(pblk, pblk->min_write_pgs); |