lightnvm: pblk: fix incorrect min_write_pgs
authorMatias Bjørling <mb@lightnvm.io>
Tue, 9 Oct 2018 11:11:38 +0000 (13:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:06 +0000 (08:25 -0600)
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>
drivers/lightnvm/pblk-init.c

index 9119c64d6f62298cbfdf36ee9c1305e6315db484..8adc8ac8b03ca0dc521ea65cd313db1e1df6e93c 100644 (file)
@@ -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);